From: John H. <jdh...@ac...> - 2004-04-26 14:55:34
|
>>>>> "Gary" == Gary Ruben <ga...@em...> writes: Gary> Just a little follow-up point. The normal axis autoscaling, Gary> with "plot(t, s, 'b-')" commented out, doesn't take account Gary> of the errorbar extrema. That is, the errorbars extend Gary> beyond the autoscaled window, whereas the window should be Gary> scaled to fully contain the errorbars. Hi Gary, it turns out there were two problems here, one trivial, one less so. The trivial problem was that we were not callling self.xaxis.autoscale_view() self.yaxis.autoscale_view() from Axes.errorbar. That's why you saw the effect of commenting and uncommenting the plot command. The deeper problem was that the errorbar caps are specified in points but the errorbars themselves are in data coords. All lines know how to transform themselves to display, but to properly autoscale the view lim we needed to know the cap dimensions in data coords. The fix was to modify axes.add_line to detect the case where the line data was not in data coords and then get the line extent in data coords by doing line coords -> display coords -> inverse data transform -> data coords. The short answer is it works now and will be included in the upcoming 0.53.1 bugfix release. JDH |