From: John H. <jdh...@ac...> - 2004-09-22 12:21:18
|
>>>>> "Fl=E1vio" =3D=3D Fl=E1vio Code=E7o Coelho <fcc...@fi...> wr= ites: Fl=E1vio> Hi john, I am getting a bad autoscale when I generate a Fl=E1vio> two point y-error errorbar plot: Fl=E1vio> As you can see in the figure attached the points are Fl=E1vio> falling on the margin of the plot. 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. 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. 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 from matplotlib.matlab import * plot([1,2], 'o') show() it seems like you want the viewlim to exceed the datalim. In cases like from matplotlib.matlab import * t =3D linspace(0,1,100) plot(t, sin(2*pi*t)) show() it looks to me like having the xlim at 0,1 is the best solution. To change the behavior, edit matplotlib/ticker.py and search for class MultipleLocator. In the autoscale method, change vmin =3D self.base.le(dmin) vmax =3D self.base.ge(dmax) to vmin =3D self.base.lt(dmin) vmax =3D self.base.gt(dmax) and try both of the examples above in the le/ge case and in the lt/gt case. JDH |