On Thu, Jan 20, 2011 at 4:44 AM, Stephan Markus <zw...@web.de> wrote:
>
> Hello!
>
> I am also using two axes in a plot and want to be able to pick the lines of
> both axes.
> So far I used MPL 0.99.3 and a button on my interface to change the z-order
> of the axes in order to be able to pick lines of the "active" axes and to
> see the correct x/y data in the navigation toolbar. The callback code of my
> button is basically the code from othererik.
>
> Since MPL 1.0.0 I have the problem that lines of the second axes simply
> disappear from the plot whenever the plot is redrawn and it's zorder is
> higher.

This thread, in which I asked a similar question and receive a
workable solution from JJ, might be helpful.  I am now just
automatically moving all my lines over to the highest z-order axis so
that whatever is visible is pickable.  (But see below for a gotcha)

http://old.nabble.com/unable-to-point-pick-2nd-axis-after-upgrade-to-mpl-1.0-td30400311.html

On this note, to the developers:  This need to take into account the
z-order for picking lines has made my development more difficult.  I
have had a week's delay due to a difficult-to-understand bug in my
code in which I prematurely moved the line over to the highest z-order
axis, and then tried to format the axis with a custom
formatter--causing an error.  Simply moving the line only after all
formatting is done fixed the bug, but that wasn't obvious for a while.
The need to track which lines are on which z-order and to move them
only after all formatting/locating has been done on them strikes me as
a new "gotcha" that the simpler and more intuitive approach of "if you
can see it, you can pick it" didn't have. (I have a somewhat complex
case, though, in which there are three possible sorts of axes that
could wind up on either the right or left sides).

It also seems counter-intuitive that a line can "belong" to an axis
from the in Matplotlib and yet for the user it clearly is measured
using the other axis.  Could "z-order mattering" be toggled?  Anyway,
my 2 cents.

Thanks,
Che

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to