From: Fabrice S. <si...@lm...> - 2008-05-06 14:54:24
|
Contrary to what the on-line doc says, the set_xticks method of an axes instance does not have the 'minor' keyword argument... S1.set_xticks(Xticksm, minor=True) TypeError: set_xticks() got an unexpected keyword argument 'minor' __version__ = '0.90.1' __revision__ = '$Revision: 3333 $' __date__ = '$Date: 2007-05-31 09:52:25 -0400 (Thu, 31 May 2007) $' |
From: John H. <jd...@gm...> - 2008-05-06 15:17:32
|
On Tue, May 6, 2008 at 9:33 AM, Fabrice Silva <si...@lm...> wrote: > Contrary to what the on-line doc says, the set_xticks method of an axes > instance does not have the 'minor' keyword argument... > > > S1.set_xticks(Xticksm, minor=True) > TypeError: set_xticks() got an unexpected keyword argument 'minor' > > > __version__ = '0.90.1' > __revision__ = '$Revision: 3333 $' > __date__ = '$Date: 2007-05-31 09:52:25 -0400 (Thu, 31 May 2007) $' This works for me -- I wonder if your version is out of date. 0.90.1 is pretty old In [7]: ax.set_xticks([1.1,1.2,1.3], minor=True) Out[7]: [<matplotlib.axis.XTick instance at 0x817418c>, <matplotlib.axis.XTick instance at 0x8f318ec>, <matplotlib.axis.XTick instance at 0x8f319cc>] In [8]: draw() In [9]: matplotlib.__version__ Out[9]: '0.91.2svn' JDH > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Yves R. <yve...@ep...> - 2008-05-06 16:18:57
|
Hi all, How is it possible to display by default the minor ticks with an interval 5 times smaller than the major ticks. I can do that for a known range of data : for example : ax = pt.gca() ax.xaxis.set_major_locator(MultipleLocator(10)) ax.xaxis.set_minor_locator(MultipleLocator(10/5.)) but I would like to have the major still set by default, i.e. : ax.xaxis.set_major_locator(AutoLocator()) and now the minor automatically set to 1/5. of the value used for the major. How can I do that ? Thanks for your help, yves -- (o o) --------------------------------------------oOO--(_)--OOo------- Yves Revaz Laboratory of Astrophysics EPFL Observatoire de Sauverny Tel : ++ 41 22 379 24 28 51. Ch. des Maillettes Fax : ++ 41 22 379 22 05 1290 Sauverny e-mail : Yve...@ep... SWITZERLAND Web : http://www.lunix.ch/revaz/ ---------------------------------------------------------------- |
From: Yves R. <yve...@ep...> - 2008-05-08 10:17:01
|
Dear List, How is it possible to write legend text with LateX fonts ? Even with rc('text', usetex=True) the legend created with the command "legend" do not appear with LateX fonts. I try something like : pt.legend(('$\rm{total baryons}$')) but the \rm is badly interpreted :-( . Thanks for your help. yves -- (o o) --------------------------------------------oOO--(_)--OOo------- Yves Revaz Laboratory of Astrophysics EPFL Observatoire de Sauverny Tel : ++ 41 22 379 24 28 51. Ch. des Maillettes Fax : ++ 41 22 379 22 05 1290 Sauverny e-mail : Yve...@ep... SWITZERLAND Web : http://www.lunix.ch/revaz/ ---------------------------------------------------------------- |
From: Darren D. <dar...@co...> - 2008-05-08 10:50:30
|
On Thursday 08 May 2008 5:13:20 am Yves Revaz wrote: > Dear List, > > How is it possible to write legend text with LateX fonts ? > Even with > rc('text', usetex=True) > the legend created with the command "legend" do not appear with LateX > fonts. > > I try something like : > > pt.legend(('$\rm{total baryons}$')) > > but the \rm is badly interpreted :-( . Does this work better? pt.legend((r'$\rm{total baryons}$')) |
From: Yves R. <yve...@ep...> - 2008-08-20 10:26:09
|
Yves Revaz wrote: > Hi all, > > How is it possible to display by default the minor ticks with an > interval 5 times > smaller than the major ticks. > > I can do that for a known range of data : for example : > > ax = pt.gca() > ax.xaxis.set_major_locator(MultipleLocator(10)) > ax.xaxis.set_minor_locator(MultipleLocator(10/5.)) > > > but I would like to have the major still set by default, i.e. : > ax.xaxis.set_major_locator(AutoLocator()) > > and now the minor automatically set to 1/5. of the value used for the major. > > How can I do that ? > Dear Yves, Here is the trick : ax = gca() ax.xaxis.set_major_locator(AutoLocator()) x_major = ax.xaxis.get_majorticklocs() dx_minor = (x_major[-1]-x_major[0])/(len(x_major)-1) /5. ax.xaxis.set_minor_locator(MultipleLocator(dx_minor)) Cheers ! yves > > Thanks for your help, > > yves > > > > > -- > (o o) > --------------------------------------------oOO--(_)--OOo------- > Yves Revaz > Laboratory of Astrophysics EPFL > Observatoire de Sauverny Tel : ++ 41 22 379 24 28 > 51. Ch. des Maillettes Fax : ++ 41 22 379 22 05 > 1290 Sauverny e-mail : Yve...@ep... > SWITZERLAND Web : http://www.lunix.ch/revaz/ > ---------------------------------------------------------------- > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- (o o) --------------------------------------------oOO--(_)--OOo------- Yves Revaz Laboratory of Astrophysics EPFL Observatoire de Sauverny Tel : ++ 41 22 379 24 28 51. Ch. des Maillettes Fax : ++ 41 22 379 22 05 1290 Sauverny e-mail : Yve...@ep... SWITZERLAND Web : http://www.lunix.ch/revaz/ ---------------------------------------------------------------- |