Skip to content

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

Closed

Description

@lkluft

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.

Activity

  1. lkluft commented on Jun 25, 2019

    @lkluft
    Author

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

  2. added this to the v3.1.1 milestone on Jun 30, 2019
  3. ivanov commented on Jun 30, 2019

    @ivanov
    Member

    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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions