plotyy equivalent?

Hi All,
I am wanting to make a plot with a secondary y axis, just like the matlab function plotyy does. Does anyone have any tips on how to do this with matplotlib?

Cheers,
Cory.

···

--
---------------------------------------------------
Cory Davis
Institute for Atmospheric and Environmental Science
Room 307, Crew Building, Kings Buildings,
University of Edinburgh. Edinburgh EH9 3JN
phone: +44 131 6505092
www: http://www.geos.ed.ac.uk/contacts/homes/cdavis

Hi all,
I have now figured out how to do this. It goes something like...

x=arange(10)
y1=sin(x)
y2=10*cos(x)

rect=[0.1,0.1,0.8,0.8]
a1=axes(rect)
a1.yaxis.tick_left()
plot(x,y1)
ylabel('axis 1')
xlabel('x')

a2=axes(rect,frameon=False)
a2.yaxis.tick_right()
plot(x,y2)
a2.yaxis.set_label_position('right')
ylabel('axis 2')
a2.set_xticks([])

Cheers,
Cory.

Cory Davis wrote:

···

Hi All,
I am wanting to make a plot with a secondary y axis, just like the matlab function plotyy does. Does anyone have any tips on how to do this with matplotlib?

Cheers,
Cory.