Skip to content

axis offset texts not moving when tick & labels are displaced using rcParams or Axes.tick_params #19471

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

Open
anntzer opened this issue Feb 7, 2021 · 1 comment
Labels
keep Items to be ignored by the “Stale” Github Action topic: ticks axis labels

Comments

@anntzer
Copy link
Contributor

anntzer commented Feb 7, 2021

Bug report

Bug summary

Moving ticks and labels to the top and right axis using rcParams or Axes.tick_params() doesn't move the offset text as well.

Code for reproduction

from pylab import *
rcdefaults()

rcParams.update({
    "xtick.top": 1, "xtick.labeltop": 1, "xtick.bottom": 0, "xtick.labelbottom": 0,
    "ytick.right": 1, "ytick.labelright": 1, "ytick.left": 0, "ytick.labelleft": 0,})
figure().add_subplot().set(xlim=(10001, 10002), ylim=(10001, 10002))
savefig("/tmp/rc.png")

rcdefaults()
figure().add_subplot().set(xlim=(10001, 10002), ylim=(10001, 10002))
gca().tick_params(top=True, labeltop=True, bottom=False, labelbottom=False,
                  right=True, labelright=True, left=False, labelleft=False)
savefig("/tmp/tickparams.png")

rcdefaults()
figure().add_subplot().set(xlim=(10001, 10002), ylim=(10001, 10002))
gca().xaxis.tick_top()
gca().yaxis.tick_right()
savefig("/tmp/tick_dir.png")

Actual outcome

Positioning via rcParams:
rc
via Axes.tick_params():
tickparams
via XAxis.tick_top()/YAxis.tick_right():
tick_dir

Only the latest approach works. (The offset texts are overlapping, but that's another issue...)

Expected outcome

Same as XAxis.tick_top()/YAxis.tick_right()

Matplotlib version

  • Operating system: linux
  • Matplotlib version (import matplotlib; print(matplotlib.__version__)): HEAD
  • Matplotlib backend (print(matplotlib.get_backend())): agg
  • Python version: 39
  • Jupyter version (if applicable):
  • Other libraries:
@github-actions
Copy link

github-actions bot commented Oct 6, 2023

This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

@github-actions github-actions bot added the status: inactive Marked by the “Stale” Github Action label Oct 6, 2023
@jklymak jklymak added keep Items to be ignored by the “Stale” Github Action and removed status: inactive Marked by the “Stale” Github Action labels Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep Items to be ignored by the “Stale” Github Action topic: ticks axis labels
Projects
None yet
Development

No branches or pull requests

2 participants