1

I've seen a lot of solutions where the tick marks are placed at specific location: I want the tick marks to be automatically spaced, but I only want ten of them. I haven't seen any solutions for setting an exact number of ticks. Preferably, the ends of the figure will also be labeled with the tick marks. How can I just set the number of tick marks?

adamcircle
  • 694
  • 1
  • 10
  • 26

1 Answers1

-1
pyplot.locator_params(axis='y', nbins=10)   # y-axis

pyplot.locator_params(axis='x', nbins=10)  # x-axis

pyplot.locator_params(nbins=10)   # both

See also: http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.locator_params

B. Eckles
  • 1,626
  • 2
  • 15
  • 27