Changing the count of numbers of the y-axis (Python, matplotlib.pyplot) -


i have small problem pyplot.

i plotting data in way like:

import matplotlib.pyplot plt  plt.subplot(i,3,j) plt.plot(xy.data) plt.show() 

with several subplots. problem is: when have many subplots, plots become small , espacially flat. numbers on y-axis become impossible read, cause overlap each other.

is somehow possible change count of numbers 3? have maximum, 0 , minimum? not minimum of function, rather keep minimum (and max) there. let every step inbetween current min, 0 , max away.

thank all, have nice day.

from matplotlib.ticker import maxnlocator plt.gca().yaxis.set_major_locator(maxnlocator(3)) 

maxnlocator sets amount of ticks, , plt.gca().yaxis make happen on y-axis.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -