python - Number of bins in matplotlib axes (number of majorticks) -


i have 6 axes in 1 figure. limits on each axes different. on each axes gave command:

ax.locator_params(axis='x', nbins=9) ax.locator_params(axis='y', nbins=7) 

but when plot get:

enter image description here

i want 9 majorticks 9 labels on x axis of each axes, , 7 on y axis of each axes. how can achieve this? lot.

from matplotlib.ticker import maxnlocator import matplotlib.pyplot plt   fig, (ax1, ax2, ax3, ax4, ax5, ax6) = plt.subplots(nrows=2, ncols=3) # add plot code here ax1.xaxis.set_major_locator(maxnlocator(nbins=9)) ax1.yaxis.set_major_locator(maxnlocator(nbins=7)) #repeat other axes 

Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -