|
From: Gregory L. <gre...@ff...> - 2004-08-19 01:58:56
|
Hi, I though about this too and your message has convinced me it was
worth spending a few minutes adding this ;-)
I just patched loglocator and logformater to be able to use arbitrary
base, and also to use arbitrary "minor" ticks. Well, I put minor between
quotes because Logticker do not really use minor ticks, only discard
label for ticks that are not integer exponents of base...
Usage is like this:
Semilogx(x,y)
#compatible with previous usage
gca().set_xscale('log')=20
# major tick every 10**i, minor tick every range(2,10)*10**I
#change base
gca().set_xscale('log',base=3D16)
#Major tick every 16**i, minor tick every range(2,16)*16**i=20
#full control
gca().set_xscale('log',base=3D100,subs=3D[10,20,50])
#Major tick every 16**i, minor tick every subs*16**i=20
This gives me all the flexibility I need, and I feel it is a step in the
right direction, but:
-maybe a rework of log ticker is needed so that it use minor/major tick
mechanism? Current mechanism is not as clean as it could, imho
-maybe autoscale for loglocator should adjust the base/range to avoid
excessive ticking (A discussion I had with john, with a zoom out it is
possible to have very dense ticking)...Not so easy to do though, as subs
has to be adjusted too if one does not want too many minor ticks, as
this adjustment is not so easy to do if one want "usefull" minor ticks
in logscale...
I thing these 2 points are linked, I would not go to 2 if 1 is not done,
but if one is done (using some kind of linear locator (with autoscale
capability) on 1 decade for minor ticks, and repeat this minor tick on
each decade as I have done with my subs, I think we can have a very nice
framework to have fully automatic and nicely configurable log ticking
:-)=20
Best regards,
Greg.
PS: the 2 modified files are included, I made my modif relative to
CVS...
> -----Message d'origine-----
> De : mat...@li...=20
> [mailto:mat...@li...] De la=20
> part de Dominique Orban
> Envoy=E9 : mardi 17 ao=FBt 2004 18:57
> =C0 : mat...@li...
> Objet : [Matplotlib-users] Log plot in base b?
>=20
>=20
> Hi,
>=20
> What would be the easiest way, in matplotlib, to achieve log scaling,=20
> along the x axis, say, in a base other than 10? I see in axes.py that=20
> semilog[xy] have LOG10 hardwired. I am using matplotlib 0.60.2.
>=20
> Thanks,
> Dominique
>=20
>=20
>=20
> -------------------------------------------------------
> SF.Net email is sponsored by Shop4tech.com-Lowest price on=20
> Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic=20
> DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free=20
> Shipping and Free Gift.=20
> http://www.shop4tech.com/z/Inkjet_Cartridge> s/9_108_r285
>=20
> _______________________________________________
>=20
> Matplotlib-users mailing list Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>=20
|