Hi,
In the code below legend(label) for ax2 is shown as ax2.legend() is called
after ax1.legend().
Both plots do show up as expected.

What should I do to get the legends for both plots.

Thank you
Raju
--------------------------------------
import matplotlib.pyplot as plt
import numpy as py
x=np.arange(0.0,np.e,0.02)
y1=np.exp(-x)
y2=np.exp(x)
fig = plt.figure()
ax1=fig.add_subplot(111)
ax2=ax1.twinx()
ax1.plot(x,y1,label="First")
ax2.plot(x,y2,label="Second")
ax1.legend()
ax2.legend()
plt.show()

-- 
Hemantharaju Subbanna
408-857-9414(cell)
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to