[matplotlib-devel] "shared axes" bug in matplotlib 0.98
Hi,
I narrowed down the problem I've posted on the matplotlib user list
and now it looks like I found a matplotlib bug in 0.98 version.
The shared axes auto-scaling is not properly working in 0.98 (works
with the 0.91). Indeed, As shown, in the small attached script, the
shared x scale does not show the full curves (axs1 blue curve should go
up to 120 on axis).
In fact, if x axes is shared, the figure xmin and xmax are defined by
the last plotted axes (axs2) and does not take into account the min/max
from the first one which cut it. One would expect to see both curve
entirely.
Could someone have look at this problem. I will try to dive in
matplotlib code but I'm not an expert at all...
Thanks in advance,
David
import matplotlib
matplotlib.use('gtkagg')
import pylab as pl
if __name__ == "__main__":
axs1 = pl.subplot(111)
t = pl.arange(0.01, 200.0, 0.01)
s1 = pl.log(t)
pl.plot(t, s1, 'b-')
axs2 = pl.gcf().add_axes(axs1.get_position(),
sharex=axs1, frameon=False)
pl.plot([-20,30], [1,2], 'r-')
pl.show()
-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] "shared axes" bug in matplotlib 0.98
David Trem wrote: > Hi, > > I narrowed down the problem I've posted on the matplotlib user list > and now it looks like I found a matplotlib bug in 0.98 version. > > The shared axes auto-scaling is not properly working in 0.98 (works > with the 0.91). Indeed, As shown, in the small attached script, the > shared x scale does not show the full curves (axs1 blue curve should go > up to 120 on axis). > In fact, if x axes is shared, the figure xmin and xmax are defined by > the last plotted axes (axs2) and does not take into account the min/max > from the first one which cut it. One would expect to see both curve > entirely. > > Could someone have look at this problem. I will try to dive in > matplotlib code but I'm not an expert at all... David, This looks like a rather fundamental problem in the present architecture. I thought I had a solution figured out, but I was wrong, and now I am not confident that I can come up with a good solution quickly. Some consultation with, or intervention by, Mike D. may be needed--he might even see a solution in a matter of minutes. The problem is that the dataLim for each axes object is a Bbox, and in this implementation there is no way to share an x-interval or a y-interval among Bboxes. So there is a single xaxis major locator that is shared, but it is only getting its dataLim updated from one of the shared axes. Eric > > Thanks in advance, > > David - Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 ___ Matplotlib-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
