Matplotlib एकल सरणी। मार्कर कैसे रखें?

मुझे एक साजिश पर एक मार्कर रखने में मदद की ज़रूरत है जहां मेरे पास साजिश करने के लिए एक ही सरणी है। मुझे एक उपकरण से एएससीआईआई प्रारूप में डेटा प्राप्त हो रहा है और मुझे डेटा से अधिकतम दिखाना होगा।

data1 = ['+3.613512E+003', '+3.254965E+003', '+2.938281E+003', '+2.678804E+003', '+2.461425E+003', '+2.282802E+003', '+2.128352E+003', '+2.001264E+003', '+1.883186E+003', '+1.774222E+003', '+1.681822E+003', '+1.601852E+003', '+1.524412E+003', '+1.458368E+003', '+1.394319E+003', '+1.338477E+003', '+1.282567E+003', '+1.206847E+003', '+1.305292E+003', '+1.175656E+003', '+1.082040E+003', '+1.050308E+003', '+1.033320E+003', '+9.772695E+002', '+9.437070E+002', '+1.039622E+003', '+8.937933E+002', '+8.677546E+002', '+8.302201E+002', '+8.098771E+002', '+7.839208E+002', '+7.641392E+002', '+7.450735E+002', '+7.270004E+002', '+7.100223E+002', '+6.938470E+002', '+6.777757E+002', '+6.627379E+002', '+6.484218E+002', '+6.346696E+002', '+6.215515E+002', '+6.091346E+002', '+5.969252E+002', '+5.858983E+002', '+5.738594E+002', '+5.632513E+002', '+5.531273E+002', '+5.434016E+002', '+5.338579E+002', '+5.245516E+002', '+5.156342E+002', '+5.069659E+002', '+4.985686E+002', '+4.904806E+002', '+4.827541E+002', '+4.751310E+002', '+4.678062E+002', '+4.606243E+002', '+4.540762E+002', '+4.473115E+002', '+4.408354E+002', '+4.345136E+002', '+4.282921E+002', '+4.223657E+002', '+4.166439E+002', '+4.109633E+002', '+4.052994E+002', '+4.001460E+002', '+3.950479E+002', '+3.895703E+002', '+3.846584E+002', '+3.799026E+002', '+3.751604E+002', '+3.705536E+002', '+3.660702E+002', '+3.616293E+002', '+3.573076E+002', '+3.532868E+002', '+3.491588E+002', '+3.450848E+002', '+3.411576E+002', '+3.377792E+002', '+3.338940E+002', '+3.302851E+002', '+3.267181E+002', '+3.232689E+002', '+3.197983E+002', '+3.162835E+002', '+3.130360E+002', '+3.098477E+002', '+3.066972E+002', '+3.036430E+002', '+3.005474E+002', '+3.017997E+002', '+2.970689E+002', '+2.943995E+002', '+2.906300E+002', '+2.872129E+002', '+2.844009E+002', '+2.817743E+002', '+2.791834E+002', '+2.766238E+002', '+2.741659E+002', '+2.715812E+002', '+2.691083E+002', '+2.667481E+002', '+2.643162E+002', '+2.620564E+002', '+2.597600E+002', '+2.575768E+002', '+2.553911E+002', '+2.532829E+002', '+2.512116E+002', '+2.491187E+002', '+2.471341E+002', '+2.451769E+002', '+2.431930E+002', '+2.412911E+002', '+2.394064E+002', '+2.375465E+002', '+2.357066E+002', '+2.338903E+002', '+2.321306E+002', '+2.304057E+002', '+2.286812E+002', '+2.269622E+002', '+2.252647E+002', '+2.236192E+002', '+2.220235E+002', '+2.204091E+002', '+2.187952E+002', '+2.172741E+002', '+2.157154E+002', '+2.142141E+002', '+2.127425E+002', '+2.112572E+002', '+2.098584E+002', '+2.084018E+002', '+2.069778E+002', '+2.055735E+002', '+2.042013E+002', '+2.028710E+002', '+2.015256E+002', '+2.001832E+002', '+1.988509E+002', '+1.976151E+002', '+1.962977E+002', '+1.950415E+002', '+1.937939E+002', '+1.925864E+002', '+1.913902E+002', '+1.901835E+002', '+1.890085E+002', '+1.878839E+002', '+1.866942E+002', '+1.855853E+002', '+1.844479E+002', '+1.833570E+002', '+1.822493E+002', '+1.812235E+002', '+1.801365E+002', '+1.790499E+002', '+1.780047E+002', '+1.769968E+002', '+1.759927E+002', '+1.750180E+002', '+1.740273E+002', '+1.730415E+002', '+1.720515E+002', '+1.711011E+002', '+1.701719E+002', '+1.691869E+002', '+1.682416E+002', '+1.673085E+002', '+1.664250E+002', '+1.655093E+002', '+1.646449E+002', '+1.637369E+002', '+1.628466E+002', '+1.619780E+002', '+1.611095E+002', '+1.602561E+002', '+1.594323E+002', '+1.585906E+002', '+1.577531E+002', '+1.569217E+002', '+1.561373E+002', '+1.553389E+002', '+1.544064E+002', '+1.536059E+002', '+1.528021E+002', '+1.520318E+002', '+1.512934E+002', '+1.505179E+002', '+1.497283E+002', '+1.489904E+002', '+1.482520E+002', '+1.475254E+002', '+1.467694E+002', '+1.460747E+002', '+1.453611E+002', '+1.446382E+002', '+1.439315E+002', '+1.432143E+002', '+1.425103E+002', '+1.417149E+002', '+1.410070E+002', '+1.402541E+002', '+1.395410E+002', '+1.388785E+002', '+1.381431E+002', '+1.373078E+002', '+1.684952E+002', '+1.735877E+002', '+1.736905E+002', '+1.724396E+002', '+1.723501E+002', '+1.712648E+002', '+1.702213E+002', '+1.694995E+002', '+1.641237E+002', '+1.672958E+002', '+1.667476E+002', '+1.663030E+002', '+1.641203E+002', '+1.632126E+002', '+1.633912E+002', '+1.483224E+002', '+1.620106E+002', '+1.601923E+002', '+1.480895E+002', '+1.578381E+002', '+1.538800E+002', '+1.560681E+002', '+1.555004E+002', '+1.551293E+002', '+1.540278E+002', '+1.538509E+002', '+1.137378E+002', '+1.149281E+002', '+1.331568E+002', '+1.163174E+002', '+1.484713E+002', '+1.374809E+002', '+1.209934E+002', '+1.355725E+002', '+1.244279E+002', '+1.306587E+002', '+1.331157E+002', '+1.183870E+002', '+1.453551E+002', '+1.456716E+002', '+1.460490E+002', '+1.468411E+002', '+1.246836E+002', '+1.068057E+002', '+1.070509E+002', '+1.058016E+002', '+1.050916E+002', '+1.045803E+002', '+1.040473E+002', '+1.038528E+002', '+1.035256E+002', '+1.031659E+002', '+1.036214E+002', '+1.028437E+002', '+1.025061E+002', '+1.020744E+002', '+1.012982E+002', '+1.005843E+002', '+9.998238E+001', '+9.969476E+001', '+9.923706E+001', '+9.881256E+001', '+9.842982E+001', '+9.800894E+001', '+9.748767E+001', '+9.712620E+001', '+9.671126E+001', '+9.626345E+001', '+9.584901E+001', '+9.545324E+001', '+9.508974E+001', '+9.469621E+001', '+9.432220E+001', '+9.393491E+001', '+9.353947E+001', '+9.313336E+001', '+9.277773E+001', '+9.238824E+001', '+9.200987E+001', '+9.167109E+001', '+9.128713E+001', '+9.091743E+001', '+9.057329E+001', '+9.020973E+001', '+8.984316E+001', '+8.949557E+001', '+8.912196E+001', '+8.875691E+001', '+8.841611E+001', '+8.805997E+001', '+8.772364E+001', '+8.736395E+001', '+8.701781E+001', '+8.669288E+001', '+8.634227E+001', '+8.601115E+001', '+8.567466E+001', '+8.535136E+001', '+8.501521E+001', '+8.468584E+001', '+8.436098E+001', '+8.402540E+001', '+8.369189E+001', '+8.339007E+001', '+8.306447E+001', '+8.268069E+001', '+8.237523E+001', '+8.205933E+001', '+8.173785E+001', '+8.143002E+001', '+8.110356E+001', '+8.081547E+001', '+8.049152E+001', '+8.018866E+001', '+7.988463E+001', '+7.958813E+001', '+7.929669E+001', '+7.898972E+001', '+7.870305E+001', '+7.840586E+001', '+7.810417E+001', '+7.781810E+001', '+7.751254E+001', '+7.724322E+001', '+7.695685E+001', '+7.667106E+001', '+7.638483E+001', '+7.608351E+001', '+7.582215E+001', '+7.553214E+001', '+7.525329E+001', '+7.498496E+001', '+7.471650E+001', '+7.443971E+001', '+7.415194E+001', '+7.388024E+001', '+7.361698E+001', '+7.334940E+001', '+7.308756E+001', '+7.281303E+001', '+7.254472E+001', '+7.226702E+001', '+7.201777E+001', '+7.174941E+001', '+7.147430E+001', '+7.121555E+001', '+7.096093E+001', '+7.071474E+001', '+7.045128E+001', '+7.021187E+001', '+6.993744E+001', '+6.967589E+001', '+6.944630E+001', '+6.917857E+001', '+6.895017E+001', '+6.870533E+001', '+6.844669E+001', '+6.820834E+001', '+6.795781E+001', '+6.770843E+001', '+6.745764E+001', '+6.723641E+001', '+6.698412E+001', '+6.674328E+001', '+6.652545E+001', '+6.619181E+001', '+6.596429E+001', '+6.571574E+001', '+6.548972E+001', '+6.525136E+001', '+6.502782E+001', '+6.480130E+001', '+6.456667E+001', '+6.434721E+001', '+6.412099E+001', '+6.388386E+001', '+6.366047E+001', '+6.343237E+001', '+6.320449E+001', '+6.298954E+001', '+6.276783E+001', '+6.255270E+001', '+6.232435E+001', '+6.210109E+001', '+6.188115E+001', '+6.166356E+001', '+6.143953E+001', '+6.121707E+001', '+6.100292E+001', '+6.078659E+001', '+6.057097E+001', '+6.035145E+001', '+6.014175E+001', '+5.991059E+001', '+5.970481E+001', '+5.949521E+001', '+5.927445E+001', '+5.907165E+001', '+5.885614E+001', '+5.864709E+001', '+5.843498E+001', '+5.822685E+001', '+5.801301E+001', '+5.780876E+001', '+5.759846E+001', '+5.739663E+001', '+5.718951E+001', '+5.698102E+001', '+5.678605E+001', '+5.657612E+001', '+5.637002E+001', '+5.616689E+001', '+5.596377E+001', '+5.576709E+001', '+5.557257E+001', '+5.536623E+001', '+5.516058E+001', '+5.496573E+001', '+5.476174E+001', '+5.456344E+001', '+5.436157E+001', '+5.416981E+001', '+5.397050E+001', '+5.377424E+001', '+5.357103E+001', '+5.336912E+001', '+5.316929E+001', '+5.297410E+001', '+5.276654E+001', '+5.257870E+001', '+5.238750E+001', '+5.220484E+001', '+5.204231E+001', '+5.190308E+001', '+5.178245E+001', '+5.165954E+001', '+5.153503E+001', '+5.138365E+001', '+5.120867E+001', '+5.102927E+001', '+5.083576E+001', '+5.065108E+001', '+5.045392E+001', '+5.025868E+001', '+5.006661E+001', '+4.988470E+001', '+4.969613E+001', '+4.951303E+001', '+4.933138E+001', '+4.914930E+001', '+4.896135E+001', '+4.877748E+001', '+4.860034E+001', '+4.841330E+001', '+4.824212E+001', '+4.806575E+001', '+4.788797E+001', '+4.771051E+001', '+4.753675E+001', '+4.735909E+001', '+4.718176E+001', '+4.700731E+001', '+4.683031E+001', '+4.665898E+001', '+4.648703E+001', '+4.631637E+001', '+4.614460E+001', '+4.597308E+001', '+4.580191E+001', '+4.562511E+001', '+4.545533E+001', '+4.528366E+001', '+4.512331E+001', '+4.495305E+001', '+4.478601E+001', '+4.461633E+001', '+4.444767E+001', '+4.428210E+001', '+4.411116E+001', '+4.395391E+001', '+4.379014E+001', '+4.362938E+001', '+4.346444E+001', '+4.330422E+001', '+4.313985E+001', '+4.298162E+001', '+4.282053E+001', '+4.265580E+001', '+4.250266E+001', '+4.234859E+001', '+4.218993E+001', '+4.203496E+001', '+4.188165E+001', '+4.172267E+001', '+4.156570E+001', '+4.141064E+001', '+4.125544E+001', '+4.110427E+001', '+4.095432E+001', '+4.080393E+001', '+4.065228E+001', '+4.049882E+001', '+4.034602E+001', '+4.018733E+001', '+4.003918E+001', '+3.989019E+001', '+3.974211E+001', '+3.959248E+001', '+3.943698E+001', '+3.928801E+001', '+3.913195E+001', '+3.897686E+001', '+3.882536E+001', '+3.867223E+001', '+3.852634E+001', '+3.837497E+001', '+3.822211E+001', '+3.806639E+001', '+3.791784E+001', '+3.776393E+001', '+3.760722E+001', '+3.746251E+001', '+3.731363E+001', '+3.716455E+001', '+3.701986E+001', '+3.687104E+001', '+3.672052E+001', '+3.657313E+001', '+3.642542E+001', '+3.628076E+001', '+3.614508E+001', '+3.600813E+001', '+3.586538E+001', '+3.573092E+001', '+3.559783E+001', '+3.545735E+001', '+3.531992E+001', '+3.518596E+001', '+3.505482E+001', '+3.491584E+001', '+3.478728E+001', '+3.464755E+001', '+3.450635E+001', '+3.436318E+001', '+3.422562E+001', '+3.408432E+001', '+3.394158E+001', '+3.380819E+001', '+3.366784E+001', '+3.352764E+001', '+3.339268E+001', '+3.325951E+001', '+3.312002E+001', '+3.298310E+001', '+3.285632E+001', '+3.273411E+001', '+3.260328E+001', '+3.248444E+001', '+3.235519E+001', '+3.223281E+001', '+3.209831E+001', '+3.196900E+001', '+3.184067E+001', '+3.171203E+001', '+3.158613E+001', '+3.145369E+001', '+3.132057E+001', '+3.118515E+001', '+3.104594E+001', '+3.090917E+001', '+3.076966E+001', '+3.062852E+001', '+3.048870E+001', '+3.034690E+001', '+3.021327E+001', '+3.006848E+001', '+2.992911E+001', '+2.978255E+001', '+2.963571E+001', '+2.949521E+001', '+2.935749E+001', '+2.922154E+001', '+2.908255E+001', '+2.894538E+001', '+2.880389E+001', '+2.866224E+001', '+2.852138E+001', '+2.838099E+001', '+2.824103E+001', '+2.810569E+001', '+2.796936E+001', '+2.782681E+001', '+2.769358E+001', '+2.755541E+001', '+2.741259E+001', '+2.727313E+001', '+2.713605E+001', '+2.699783E+001', '+2.686083E+001', '+2.672147E+001', '+2.658437E+001', '+2.644625E+001', '+2.630801E+001', '+2.616512E+001', '+2.603101E+001', '+2.589232E+001', '+2.575454E+001', '+2.561644E+001', '+2.547833E+001', '+2.534183E+001', '+2.520264E+001', '+2.505910E+001', '+2.492208E+001', '+2.477909E+001', '+2.464663E+001', '+2.451152E+001', '+2.437465E+001', '+2.423483E+001', '+2.409598E+001', '+2.395972E+001', '+2.382007E+001', '+2.367959E+001', '+2.354270E+001', '+2.340146E+001', '+2.326394E+001', '+2.312208E+001', '+2.298558E+001', '+2.283982E+001', '+2.269906E+001', '+2.255732E+001', '+2.241614E+001', '+2.227514E+001', '+2.214171E+001', '+2.199491E+001', '+2.185603E+001', '+2.171301E+001', '+2.157040E+001', '+2.143086E+001', '+2.128905E+001', '+2.115195E+001', '+2.101151E+001', '+2.087426E+001', '+
0

2 उत्तर

इस वाक्यविन्यास का प्रयोग करना:

plot(..., marker="o")

"कीवर्ड" तर्क का उपयोग कर रहा है, क्योंकि केवल "स्थितित्मक" तर्क के विपरीत, जिसमें शुरुआत में कोई कीवर्ड = नहीं है, जैसा कि:

plot(x, y, '#3FF235')

जब तक "स्थिति" तर्क "कीवर्ड" तर्क से पहले आते हैं, तब तक आप उन्हें दोनों मिश्रण कर सकते हैं। यह काम करना चाहिए:

plot(x, y, '#3FF235', marker='o')

लेकिन यह नहीं होगा:

plot(x, y, marker='o', '#3FF235')

ध्यान दें कि x, y दो अलग-अलग तर्क होना चाहिए। यदि आप केवल 270 को इंगित करना चाहते हैं, तो आपको यह करना होगा:

plot(270, data1[270], '#3FF235', marker='o')

वास्तविक अधिकतम दिखाने के लिए, उपयोग करें

data1 = np.asarray(data1, float)
maxi = data1.argmax()
plot(maxi, data1[maxi], 'ro')  # can combine color and marker in one positional argument

both maxes

1
जोड़ा
आपका बहुत बहुत धन्यवाद! जवाब मैं कल पूरे दिन देख रहा था। :) अगर मैं आपको देखता हूं तो मैं आपको एक बियर खरीदूंगा :)
जोड़ा लेखक Pentarex, स्रोत

वाक्यांश "तर्क के बाद गैर-कीवर्ड तर्क" वाक्यांश नहीं है, क्या आप वास्तव में सामानों को यादृच्छिक रूप से प्रयास करने के बजाय वास्तव में इसका अर्थ पूछना चाहते हैं? सामान्य रूप से, पायथन वाक्यविन्यास func (a, b) ठीक है (कोई कीवर्ड तर्क नहीं है), और func (a, option = b) भी ठीक है (कोई कीवर्ड है अंत में "विकल्प" नाम का तर्क; लेकिन func (option = b, a) की अनुमति नहीं है (यह नहीं जानता कि गैर-कीवर्ड तर्क a कीवर्ड तर्क के बाद option = b )। आपका लापता कीवर्ड है, मुझे विश्वास है, color

0
जोड़ा
आपके उत्तर के लिए धन्यवाद! मैं अजगर के लिए नया हूं और कभी-कभी आप जानते हैं कि वे आपको एक कार्य देते हैं - इसे अजगर के साथ करें। और tbh मेरे पास पढ़ने के लिए बहुत समय नहीं है। वैसे भी यह मेरा बुरा है कि मैंने इस बारे में नहीं पढ़ा है - आप सही हैं। मुझे कुछ खाली समय चाहिए जब मुझे चाहिए। और मुझे अजगर पसंद है :)
जोड़ा लेखक Pentarex, स्रोत