Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tick_right() doesn't move scale factor #4043

Closed
duncanmmacleod opened this issue Jan 28, 2015 · 1 comment
Closed

tick_right() doesn't move scale factor #4043

duncanmmacleod opened this issue Jan 28, 2015 · 1 comment

Comments

@duncanmmacleod
Copy link
Contributor

The YAxis.tick_right() method doesn't move a scale factor when the formatter introduces one. The following minimal example should demonstrate that:

import numpy
from matplotlib import pyplot
data = numpy.random.random(1e4) * 1e-22
fig, axes = pyplot.subplots(2, 1, sharex=True)
axes[0].plot(data)
axes[1].plot(data ** (.5))
axes[1].yaxis.set_label_position('right')
axes[1].yaxis.tick_right()

tick_right

The 1e-11 factor should ideally be on the right-hand-side with the tick labels.

@tacaswell tacaswell added this to the v1.4.x milestone Jan 28, 2015
@WeatherGod
Copy link
Member

Hmm, that's a bit odd. If I recall correctly, the offset/scale text is
moved to the right whenever we use twinx().

On Tue, Jan 27, 2015 at 7:20 PM, Duncan Macleod notifications@github.com
wrote:

The YAxis.tick_right()
http://matplotlib.org/api/axis_api.html#matplotlib.axis.YAxis.tick_right
method doesn't move a scale factor when the formatter introduces one. The
following minimal example should demonstrate that:

import numpyfrom matplotlib import pyplot
data = numpy.random.random(1e4) * 1e-22
fig, axes = pyplot.subplots(2, 1, sharex=True)
axes[0].plot(data)
axes[1].plot(data ** (.5))
axes[1].yaxis.set_label_position('right')
axes[1].yaxis.tick_right()

[image: tick_right]
https://cloud.githubusercontent.com/assets/1618530/5930102/c91db7fc-a650-11e4-931e-ac6013b4abe7.png

The 1e-11 factor should ideally be on the right-hand-side with the tick
labels.


Reply to this email directly or view it on GitHub
#4043.

@tacaswell tacaswell modified the milestones: v1.4.x, 1.5.0 Feb 7, 2015
lichri12 added a commit to lichri12/matplotlib that referenced this issue Feb 13, 2015
Added the line, self.set_offset_position(position) in the YAxis class (line 2026) and it appears to fix the issue of the scale factor label not moving to the right with the tick labels.
jasonliw93 pushed a commit to jasonliw93/matplotlib that referenced this issue Mar 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants