# Just Launched: You can now import projects and releases from Google Code onto SourceForge

We are excited to release new functionality to enable a 1-click import from Google Code onto the Allura platform on SourceForge. You can import tickets, wikis, source, releases, and more with a few simple steps.

## [Matplotlib-users] Two Scale Problem with ticks on secondary axis?

 [Matplotlib-users] Two Scale Problem with ticks on secondary axis? From: James Boyle - 2005-10-21 16:59:59 ```When I run the example for two scales (two_scales.py), the secondary axis - on the right- has ticks for both scales. The primary - on left - has the expected one set of ticks. I did modify the example code as shown below. Instead of calling the twinx function of pylab I explicitly took the code from pylab.py. this was because I wanted to see exactly what was being done with an intent to modify it slightly. In any case it should be completely equivalent to the example. When I did run the example unchanged it gave the same result. Is this a bug or something I am missing something ? Running matplotlib 0.84 on OS X 10.3.9 import pylab import Numeric N = Numeric PL = pylab ax1 = PL.subplot(111) t = N.arange(0.01, 10.0, 0.01) s1 = N.exp(t) PL.plot(t, s1, 'b-') PL.xlabel('time (s)') PL.ylabel('exp') # turn off the 2nd axes rectangle with frameon kwarg #ax2 = PL.twinx() ax = PL.gca() ax2 = PL.gcf().add_axes(ax.get_position(), sharex=ax, frameon=False) ax2.yaxis.tick_right() ax2.yaxis.set_label_position('right') s2 = N.sin(2*N.pi*t) PL.plot(t, s2, 'r.') PL.ylabel('sin') ax2.yaxis.tick_right() show() ```

 [Matplotlib-users] Two Scale Problem with ticks on secondary axis? From: James Boyle - 2005-10-21 16:59:59 ```When I run the example for two scales (two_scales.py), the secondary axis - on the right- has ticks for both scales. The primary - on left - has the expected one set of ticks. I did modify the example code as shown below. Instead of calling the twinx function of pylab I explicitly took the code from pylab.py. this was because I wanted to see exactly what was being done with an intent to modify it slightly. In any case it should be completely equivalent to the example. When I did run the example unchanged it gave the same result. Is this a bug or something I am missing something ? Running matplotlib 0.84 on OS X 10.3.9 import pylab import Numeric N = Numeric PL = pylab ax1 = PL.subplot(111) t = N.arange(0.01, 10.0, 0.01) s1 = N.exp(t) PL.plot(t, s1, 'b-') PL.xlabel('time (s)') PL.ylabel('exp') # turn off the 2nd axes rectangle with frameon kwarg #ax2 = PL.twinx() ax = PL.gca() ax2 = PL.gcf().add_axes(ax.get_position(), sharex=ax, frameon=False) ax2.yaxis.tick_right() ax2.yaxis.set_label_position('right') s2 = N.sin(2*N.pi*t) PL.plot(t, s2, 'r.') PL.ylabel('sin') ax2.yaxis.tick_right() show() ```
 Re: [Matplotlib-users] Two Scale Problem with ticks on secondary axis? From: John Hunter - 2005-10-26 21:12:27 ```>>>>> "James" == James Boyle writes: James> When I run the example for two scales (two_scales.py), the James> secondary axis - on the right- has ticks for both James> scales. The primary - on left - has the expected one set of James> ticks. I did modify the example code as shown James> below. Instead of calling the twinx function of pylab I James> explicitly took the code from pylab.py. this was because I James> wanted to see exactly what was being done with an intent to James> modify it slightly. In any case it should be completely James> equivalent to the example. When I did run the example James> unchanged it gave the same result. James> Is this a bug or something I am missing something ? Looks like a bug -- I see the same thing with twinx. Could you file this one of the sf site? I took a look through the axis code but couldn't find the culprit. I'm CC Baptiste who wrote the code -- maybe he has some insight. Thanks James> Running matplotlib 0.84 on OS X 10.3.9 James> import pylab import Numeric N = Numeric PL = pylab James> ax1 = PL.subplot(111) t = N.arange(0.01, 10.0, 0.01) s1 = James> N.exp(t) PL.plot(t, s1, 'b-') PL.xlabel('time (s)') James> PL.ylabel('exp') # turn off the 2nd axes rectangle with James> frameon kwarg #ax2 = PL.twinx() ax = PL.gca() ax2 = James> PL.gcf().add_axes(ax.get_position(), sharex=ax, James> frameon=False) ax2.yaxis.tick_right() James> ax2.yaxis.set_label_position('right') James> s2 = N.sin(2*N.pi*t) PL.plot(t, s2, 'r.') PL.ylabel('sin') James> ax2.yaxis.tick_right() show() James> ------------------------------------------------------- James> This SF.Net email is sponsored by: Power Architecture James> Resource Center: Free content, downloads, discussions, and James> more. http://solutions.newsforge.com/ibmarch.tmpl James> _______________________________________________ James> Matplotlib-users mailing list James> Matplotlib-users@... James> https://lists.sourceforge.net/lists/listinfo/matplotlib-users ```
 Re: [Matplotlib-users] Two Scale Problem with ticks on secondary axis? From: - 2005-10-27 11:30:10 Attachments: pylab.py.diff ```> Looks like a bug -- I see the same thing with twinx. Could you file > this one of the sf site? I took a look through the axis code but > couldn't find the culprit. I'm CC Baptiste who wrote the code -- > maybe he has some insight. > It is indeed a bug. Imho we should fix it in pylab.py, by changing the function twinx to read: def twinx(ax=3DNone): """ Make a second axes overlay ax (or the current axes if ax is None) sharing the xaxis. The ticks for ax2 will be placed on the right, and the ax2 instance is returned. See examples/two_scales.py """ if ax is None: ax=3Dgca() ax2 =3D gcf().add_axes(ax.get_position(), sharex=3Dax, frameon=3DFals= e) ax2.yaxis.tick_right() ax2.yaxis.set_label_position('right') ax.yaxis.tick_left() draw_if_interactive() return ax2 The attached one-line patch does the trick. Cheers, Baptiste```