From: Jeremy Conlin <jeremit0@gm...>  20080913 03:58:24

On Fri, Sep 12, 2008 at 4:31 PM, Jeff Whitaker <jswhit@...> wrote: > Jeremy Conlin wrote: > >> First question: >> I know I can do pylab.loglog() to get a loglog plot. I would like to >> create a loglinear plot. How can I do this? >> > > semilogx or semilogy: > > > > semilogy < > http://matplotlib.sourceforge.net/matplotlib.pyplot.html#semilogy>(*args, > **kwargs) > > Make a plot with log scaling on the *y* axis. > >> >> Second question: >> I would like to plot two sequences on the same figure with two different >> yscales, one scale shown on the left and one scale shown on the right. How >> can I do this? >> > > twiny: > > > ax = twiny > <http://matplotlib.sourceforge.net/matplotlib.axes.html#Axestwiny>;() > create a twin of Axes > <http://matplotlib.sourceforge.net/matplotlib.axes.html#Axes>; for > generating a plot with a shared > yaxis but independent x axis. The xaxis of self will have > ticks on bottom and the returned axes will have ticks on the > top > > Jeff > >> Thanks for that information, that is what I needed. But now I come up with a separate problem. I have the following in my code: pylab.plot(n, S, 'b.', label='x') pylab.legend() ax2 = pylab.twinx() pylab.plot(n, mean, 'r',label="mean") ax2.yaxis.tick_right() pylab.legend() Both plots are shown with the appropriate axes, but only the second plot is listed in the legend. If I only have the first, then only the first plot will be listed. Please help. Jeremy 