From: Darren D. <dsd...@gm...> - 2008-06-25 12:21:40
|
On Monday 23 June 2008 08:53:56 pm Adam Mercer wrote: > Hi > > Anyone know how to fix this problem? > > Cheers > > Adam > > On Thu, Jun 19, 2008 at 8:31 PM, Adam Mercer <ram...@gm...> wrote: > > Hi > > > > I have a plot that has two different y-axis scales and I want > > appropriate tick marks for the different y-axes. ie I want the tick > > marks on the left axis to correspond to the scale on the left axis > > etc... As far as I can tell the way to accomplish this, after > > consulting the documentation, is to use the tick_left() and > > tick_right() methods, I therefore have the following code: > > > > axes1.yaxis.tick_left() > > axes1.yaxis.set_major_locator(pylab.MultipleLocator(0.1)) > > axes1.yaxis.set_minor_locator(pylab.MultipleLocator(0.05)) > > axes2.yaxis.tick_right() > > axes2.yaxis.set_major_locator(pylab.MultipleLocator(5)) > > axes2.yaxis.set_minor_locator(pylab.MultipleLocator(1)) > > > > but the minor ticks are on both the left and right y-axes. How can I > > make the minor ticks for axes1 only appear on the the left and the > > minor ticks for axes2 appear on the right? I don't see a problem here. I did the following: ipython -pylab run two_scales.py ax1.yaxis.set_minor_locator(MultipleLocator(1000)) draw() # Shows minor ticks on both left and right yaxis ax1.yaxis.tick_left() draw() # shows minor ticks on left only ax2.yaxis.set_minor_locator(MultipleLocator(.1)) draw() # shows left yaxis minor ticks on left only, shows right yaxis ticks on both ax2.yaxis.tick_right() draw() # shows left yaxis minor ticks on left only, right yaxis minor ticks on # right only Darren |