[Matplotlib-users] two y axes via twinx and legends

2006-12-09 Thread belinda thom
Hi,

This mailing list is great---I've gotten a couple very useful replies  
from others in a very short time period. Thanks!

And now, onto my next question. I need to construct a two-y-axis  
plot. I've found some hints on how to do this on the mailing archive  
(Subject: secondary y-axis, Date: 9/28/05).

I've got the basics working, but have run into the same problem this  
prior post did: I want a legend that lists content from both the  
left-hand-sided plots and the right-hand-sided ones.

It appears only one axis or the others data can appear in a legend.

Is there anyway to merge the two axes into a single legend?

Also, the mail archives I'm viewing look terrible: line breaks aren't  
in the usual place, things are presented with 's in them (which  
would make sense if the line breaks were preserved, b/c they  
correspond to pieces of prior email content). I'm using Safari 2.0.4  
w/Mac OS X 10.4.8. Do others see the same thing, and if the answer is  
yes, are folks satisfied with this state of affairs?

Thanks,

--b

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] two y axes via twinx and legends

2006-12-09 Thread belinda thom
Looks like I've been able to help myself on this one. I'll post this  
here b/c others had asked about this in prior emails and I never saw  
an answer given.

You can make your own custom legend by keeping the return values from  
each plot command:

e.g.

l1 = plot(y1's stuff)
twinx()
l2 = plot(y2's stuff)

legend([l1,l2],['y1s tag','y2s tag'])

works like a charm.

HTH
--b

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users