Re: [Matplotlib-users] adding a number of minor tick marks between major tick marks feature

2010-11-30 Thread Matthias Michler
On Monday November 29 2010 22:01:29 Matthew W. Priddy 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?

Hi Matthew,

one thing, which should work is the following. If you want to set the 
positions of minor ticks of an axes 'ax', you can use

ax.set_xticks([0.02, 0.04, 0.06, 0.08, 0.1], minor=True)

but I'm not an expert and I'm not sure if something like you mentioned is 
already supported (namely providing the number of minor tick marks).

Kind regards,
Matthias

--
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


Re: [Matplotlib-users] adding a number of minor tick marks between major tick marks feature

2010-11-30 Thread Gökhan Sever
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


[Matplotlib-users] adding a number of minor tick marks between major tick marks feature

2010-11-29 Thread Matthew W. Priddy
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


--
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