Skip to content

Plotting on a log/logit scale overwrites axis inverting #14620

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

Closed
lkluft opened this issue Jun 25, 2019 · 2 comments
Closed

Plotting on a log/logit scale overwrites axis inverting #14620

lkluft opened this issue Jun 25, 2019 · 2 comments
Milestone

Comments

@lkluft
Copy link

lkluft commented Jun 25, 2019

Bug report

Bug summary

When plotting on a log axis that has been inverted, the inverting is overwritten.

This happens for "log" and "logit" scales but not for "linear" or "symlog", which both work as expected.

Code for reproduction

import matplotlib.pyplot as plt


fig, ax = plt.subplots()
ax.set_yscale('log')  # or 'logit'
ax.yaxis.set_inverted(True)

print(ax.yaxis.get_inverted())
ax.plot(range(50), range(50))
print(ax.yaxis.get_inverted())

Actual outcome

True
False
# and the plot is **not** inverted

Expected outcome

True
True
# and an inverted plot

Matplotlib version

  • Operating system: Linux and MacOS
  • Matplotlib version: 3.1.0
  • Python version: 3.7.3

Python and matplotlib have been installed using conda.

@lkluft
Copy link
Author

lkluft commented Jun 25, 2019

I am not sure if this is related to #14615 (or even a duplicate?)

@ivanov
Copy link
Member

ivanov commented Jun 30, 2019

I think it is indeed a duplicate, @lkluft, at least on v3.1.x branch, with the fixes for #14615, I do indeed get the expected True True outcome for the code snippet you provided. Thanks for filing this and
happy hacking! :bowtie:

@ivanov ivanov closed this as completed Jun 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants