1

I plot the two arrays in python. But I need to see the evolution of y axis every 100 or 1000. I hope that my question is clear.

import matplotlib.pyplot as plt

y= [303, 606, 1414, 2020, 2424, 2626, 2828, 2929, 3131, 3232, 3333, 8484, 9999, 11211, 12221, 13130, 13332, 14140, 16362, 19392, 20705, 21311, 25250, 27270, 28482]
x= [0,   4,   7    , 9,   11  ,  12  ,  14,  16,   17,  85,   108,  124 ,  139,  154 ,   157,   166,  199 ,  258 ,  276,   284,   338 ,  367 ,  382 ,  382 ,  392]
print (len(x))
print (len(y))
plt.plot(x,y)
f = plt.figure()
plt.show()

enter image description here

1 Answers1

0

You can use the method plt.yticks(np.arange(100, step=100)). np represent numpy library (import numpy as np). Also you can set a upper bound limit with a second parameter like that: plt.yticks(np.arange(100,1000,step=100)).

Hope it helps.

Andrea Naspi
  • 119
  • 1
  • 5