import matplotlib.pyplot as plt
import numpy as np

def demo_test():
    a=np.array([0.15,0.16,0.14,0.17,0.12,0.16,0.1,0.08,0.05,0.07,0.06]);
    max_indx=np.argmax(a)#max value index
    min_indx=np.argmin(a)#min value index
    plt.plot(a,'r-o')
    plt.plot(max_indx,a[max_indx],'ks')
    show_max='['+str(max_indx)+' '+str(a[max_indx])+']'
    plt.annotate(show_max,xytext=(max_indx,a[max_indx]),xy=(max_indx,a[max_indx]))
    plt.plot(min_indx,a[min_indx],'gs')
    plt.show()



if __name__=="__main__":
    demo_test();

 

 

关键是找出坐标. 

 

相关文章:

  • 2022-12-23
  • 2021-04-04
  • 2021-07-27
  • 2021-07-30
  • 2021-11-09
  • 2021-11-04
  • 2022-12-23
  • 2022-02-01
猜你喜欢
  • 2021-07-06
  • 2022-02-08
  • 2021-12-02
  • 2021-12-03
  • 2021-10-07
  • 2021-06-26
相关资源
相似解决方案