On Mon, Nov 29, 2010 at 3:01 PM, Matthew W. Priddy <mwpri...@gmail.com> wrote: > Matplotlib developers, > > I really like using matplotlib to create quality plots, and it seems to have > an option for just about everything. However, one thing that is not easy to > change is the location of minor tick marks. To set major tick mark > locations, one can simply use the "xticks" command. And now we can atleast > turn on the minor tick marks with the "minorticks_on()" command. > > But, is there any way to implement something similar to "xticks" for minor > tick marks? Even better would be a feature that allowed the user to simply > specify the number of minor tick marks that are evenly spaced between the > major tick marks? > > Thanks. > > --Matthew
It is easy with MultipleLocator class. I[1]: y = np.random.randn(100) I[2]: plt.plot(y) O[2]: [<matplotlib.lines.Line2D object at 0xa82ea6c>] I[3]: from matplotlib.ticker import MultipleLocator I[4]: ax = plt.gca() I[5]: ax.xaxis.set_minor_locator(MultipleLocator(5)) -- Gökhan ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users