My comment would be that I agree with Fl=E1vio for the specific case of e=
rrorbar plots. That is, when you have errorbars, you want them slightly i=
nset from the axes so that it's clear where they finish. I think this onl=
y applies to errorbar plots. So, if there's an easy way to have the scali=
ng differentiate, I'd say the endpoints should NOT always exceed the data=
end points, but should for errorbar plots. I'm think changing the defaul=
t behaviour would upset lots of people.
Another idea might be to just add a command like autoscale(factor) or aut=
oscale(margin) or margin(inset) to specify on a per-case basis.
Gary
----- Original Message -----
From: John Hunter <jdh...@ac...>
Date: Wed, 22 Sep 2004 06:31:58 -0500
To: Fl=E1vio Code=E7o Coelho <fcc...@fi...>
Subject: Re: [Matplotlib-users] problem with x scale on error bar plot
> >>>>> "Fl=E1vio" =3D=3D Fl=E1vio Code=E7o Coelho <fcc...@fi...> =
writes:
>=20
> Fl=E1vio> Hi john, I am getting a bad autoscale when I generate a
> Fl=E1vio> two point y-error errorbar plot:
>=20
> Fl=E1vio> As you can see in the figure attached the points are
> Fl=E1vio> falling on the margin of the plot.
>=20
> Fl=E1vio> I think a space before the first point and after the last
> Fl=E1vio> point of the plot should be added automatically, since no
> Fl=E1vio> one will want a plot like this by default.
>=20
> This is a fix that is trivial to implement. But I would like to get
> some feedback because changing the default would affect every almost
> all matplotlib plots.
>=20
> The question is: should the autoscale endpoints always exceed the data
> end points, or are there some cases in which it is desirable for the
> datalim and viewlim to coincide? In this case
>=20
> from matplotlib.matlab import *
> plot([1,2], 'o')
> show()
>=20
> it seems like you want the viewlim to exceed the datalim. In cases
> like
>=20
> from matplotlib.matlab import *
> t =3D linspace(0,1,100)
> plot(t, sin(2*pi*t))
> show()
>=20
> it looks to me like having the xlim at 0,1 is the best solution.
>=20
> To change the behavior, edit matplotlib/ticker.py and search for class
> MultipleLocator. In the autoscale method, change
>=20
> vmin =3D self.base.le(dmin)
> vmax =3D self.base.ge(dmax)
>=20
> to
> vmin =3D self.base.lt(dmin)
> vmax =3D self.base.gt(dmax)
>=20
> and try both of the examples above in the le/ge case and in the lt/gt
> case.
>=20
> JDH
>=20
>=20
> -------------------------------------------------------
> This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
> Project Admins to receive an Apple iPod Mini FREE for your judgement on
> who ports your project to Linux PPC the best. Sponsored by IBM.
> Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
--=20
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm
|