[SciPy-dev] Extra marker in X-Y plot

eric eric at scipy.org
Fri Nov 9 09:12:20 CST 2001

Hey Magnus,

If I'm following what you want here, just adding a third line will work.
For example:

>>> plt.plot((1,5,10),'b-',(1,4,8),'g-',(1.5,1.5),(0,10),'r-')

Something like this should also work:

>>> plt.plot((1,5,10),'b-',(1,4,8),'g-')
>>> plt.hold('on')
>>> plt.plot((1.5,1.5),(0,10),'r-')

The third line puts a vertical line on the graph at x=1.5.

If your looking for a way to zoom in on a relevant portion of a graph,
Jochen Kupper has added a nifty zoom feature to plt that allows you to
select a region of the graph you'd like to zoom in on with the mouse.  He
posted a patch to the list earlier that you can apply to get the zoom
feature, or you can grab it from his website I think.  As long as your not
messing with images, it works great.  Assuming we get the image issue worked
out, this'll be in the next release.

It'd also be a nice feature to specify the location of a "marker" line and
have it added automatically, but that isn't available.


----- Original Message -----
From: "Magnus Lyckå" <magnus at thinkware.se>
To: <scipy-dev at scipy.org>
Sent: Friday, November 09, 2001 7:35 AM
Subject: [SciPy-dev] Extra marker in X-Y plot

> I'm using an ordinary plt.plot to display an x-y plot
> with two curves. So far so good. The problem is that
> in many cases, only a certain portion of the curves
> are relevant, and I'd like to show that in some way.
> For instance, I could imagine a vertical line like in
> http://www.thinkware.se/tmp/plotwithmarker.jpg
> One thought was to make this a third curve, and to just
> make that a step function, or a "singularity". The
> problem is that the two "real" curves don't usually
> have a point in this x-location.
> I'm open for other solutions as well, as lines or
> point markers changing colour or shape after the relevant
> x-position (7.38 in the figure).
> Is there some feature that I overlooked?
> The closest to a solution I've found so far is to
> use plt.xaxis() to let the user toggle between showing
> all measurements or just the relevant parts. That works,
> but it doesn't give the quick visual response I want.
> Suggestions would be appreciated.
> /Magnus
> --
> Magnus Lyckå, Thinkware AB
> Älvans väg 99, SE-907 50 UMEÅ
> tel 070-582 80 65, fax: 070-612 80 65
> http://www.thinkware.se/  mailto:magnus at thinkware.se
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-dev

More information about the Scipy-dev mailing list