ax.twin returns a ParasiteAxesAuxTrans instance which is derived from the mpl's original Axes, but only drawing-related methods are meant to be meaningful. For example, this axes is never meant to be added to the figure and the draw method of this axes is never meant to be called. I haven't looked at it thoroughly but I guess the reason the callbacks are not processed is because this axes is not added to the figure and no set_xlim (or set_ylim) is explicitly called. However, consider it as a feature not a bug.
The xlim of the parasite axes is mean to be "only" changed when the xlim of the host axes changes. And the set_xlim (and set_ylim) method should not be called directly on the parasite axes. Furthermore, I don't see any reason to connect xlim_change event to the parasite axes. If there is anything you want to do when the xlim of the parasite axes change, just connect it to the host axes. If there is a case that xlim_change event should be directly connected to the parasite axes (instead of the host axes), I'll consider it as a bug and try to fix it. Regards, -JJ On Sat, May 2, 2009 at 2:03 PM, Thomas Robitaille <thomas.robitai...@gmail.com> wrote: > > There was a typo in the script, the callbacks should be > > ax.name = "first axis" > ax.callbacks.connect('xlim_changed',check_callback) > ax.callbacks.connect('ylim_changed',check_callback) > > ax2 = ax.twin() > ax2.name = "second axis" > ax2.callbacks.connect('xlim_changed',check_callback) > ax2.callbacks.connect('ylim_changed',check_callback) > > but the problem remains: check_callback is never called for ax2. > > Tom > > -- > View this message in context: > http://www.nabble.com/Enforcing-common-view-limits-tp23334325p23348806.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Register Now & Save for Velocity, the Web Performance & Operations > Conference from O'Reilly Media. Velocity features a full day of > expert-led, hands-on workshops and two days of sessions from industry > leaders in dedicated Performance & Operations tracks. Use code vel09scf > and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > ------------------------------------------------------------------------------ Register Now & Save for Velocity, the Web Performance & Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance & Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users