split axis scale

Hi,

I have a plot containing two lines that are quite far apart - ie one
line oscillates around y=2, the other around y=10. The osciallations
are small, but I would like to show the detail better (while having
htem in a single plot).

So I thought it would be nice if the y-axis scale went from 1-3 then
had a break (denoted with some kind of cross mark), then went from
9-11. I tried googling but I'm not really sure what the official name
for such a thing is, if there is one.

Is it possible to get this sort of effect with matplotlib? Or can
people suggest an alternative (I guess I will look at doing 2 subplots
one above the other very close together).

Cheers

Robin

If I'm not mistaken, you might be able to write a Transform
(http://matplotlib.sourceforge.net/devel/transformations.html) to do
this, although I'm not sure how you'd render the split-mark. I don't
really know these things though, just a thought.

- Ben

···

On Fri, 2008-11-28 at 13:09 +0000, Robin wrote:

Hi,

I have a plot containing two lines that are quite far apart - ie one
line oscillates around y=2, the other around y=10. The osciallations
are small, but I would like to show the detail better (while having
htem in a single plot).

So I thought it would be nice if the y-axis scale went from 1-3 then
had a break (denoted with some kind of cross mark), then went from
9-11. I tried googling but I'm not really sure what the official name
for such a thing is, if there is one.

Is it possible to get this sort of effect with matplotlib? Or can
people suggest an alternative (I guess I will look at doing 2 subplots
one above the other very close together).

Cheers

Robin

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Robin wrote:

Hi,

I have a plot containing two lines that are quite far apart - ie one
line oscillates around y=2, the other around y=10. The osciallations
are small, but I would like to show the detail better (while having
htem in a single plot).

I suggest using twinx(); the scale for one line will be on the left, the scale for the other on the right. You can make the scale colors match the line colors, if you want to. I just updated examples/api/two_scales.py to show this.

Eric

···

So I thought it would be nice if the y-axis scale went from 1-3 then
had a break (denoted with some kind of cross mark), then went from
9-11. I tried googling but I'm not really sure what the official name
for such a thing is, if there is one.

Is it possible to get this sort of effect with matplotlib? Or can
people suggest an alternative (I guess I will look at doing 2 subplots
one above the other very close together).

Cheers

Robin

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Hmmm, not here:
http://matplotlib.sourceforge.net/examples/api/two_scales.html
And here the test on the y-axes does not display properly on the
posted figures.

But I like the idea.

Alan Isaac

`

···

On 11/28/2008 9:21 PM Eric Firing apparently wrote:

I suggest using twinx(); the scale for one line will be on the left, the scale for the other on the right. You can make the scale colors match the line colors, if you want to. I just updated examples/api/two_scales.py to show this.

Alan G Isaac wrote:

I suggest using twinx(); the scale for one line will be on the left, the scale for the other on the right. You can make the scale colors match the line colors, if you want to. I just updated examples/api/two_scales.py to show this.

Hmmm, not here:
http://matplotlib.sourceforge.net/examples/api/two_scales.html

The web page docs don't get updated automatically every time svn changes--which is probably a good thing. The revised example is attached.

And here the test on the y-axes does not display properly on the
posted figures.

That's puzzling. It looks like some odd rcParams settings must have been used when the figures were generated for the web page.

Eric

two_scales.py (1.25 KB)

···

On 11/28/2008 9:21 PM Eric Firing apparently wrote:

But I like the idea.

Alan Isaac

`

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Obvious once you see it.
Nice.

Alan Isaac

···

On 11/29/2008 1:08 PM Eric Firing apparently wrote:
> for tl in ax2.get_yticklabels():
> tl.set_color('r')