Try something like
handles1, labels1 = ax1.get_legend_handles_labels()
handles2, labels2 = ax2.get_legend_handles_labels()
ax2.legend(handles1+handles2, labels1+labels2)
Also, see
http://matplotlib.sourceforge.net/users/legend_guide.html
Regards,
-JJ
On Sat, Sep 25, 2010 at 6:08 AM, Raju Sub
On Fri, Sep 24, 2010 at 4:08 PM, Raju Subban wrote:
> 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
>
Raju, I think ax1.legen
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.a