Re: [Matplotlib-users] [matplotib-users] missing legend-entry using twinx()

2010-01-08 Thread Jae-Joon Lee
This is because "legend" creates a legend only in the current axes. Note that "twinx" creates a separate axes. You need to manually specify which plot items to show in the legend. http://matplotlib.sourceforge.net/users/legend_guide.html Or, you may use axes_grid.parasite_axes which does this jo

[Matplotlib-users] [matplotib-users] missing legend-entry using twinx()

2010-01-07 Thread Manuel Wittchen
Hi, I'm plotting two y-axis with the twinx() command. But when I'm creating my legend there is only one entry in the legend-box instead of two. Here is my code: grafik1 = plt.figure() ax1 = grafik1.add_subplot(111) ax1.plot(TIME, BTM, color='red', label='Biomass') ax1.set_ylabel('Biomass') ax2