Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Bug]: axis set_transform and get_transform are not related #22713

Copy link
Copy link
Open
@mwaskom

Description

@mwaskom
Issue body actions

Bug summary

The XAxis / YAxis objects attached to an Axes have get_transform and set_transform methods, but unlike other getters/setters, you can't get the value you set.

Code for reproduction

import matplotlib as mpl
import matplotlib.pyplot as plt
_, ax = plt.subplots()
xfm = mpl.scale.LogTransform(10)
ax.xaxis.set_transform(xfm)
print(ax.xaxis.get_transform())

Actual outcome

IdentityTransform()

Expected outcome

LogTransform(base=10, nonpositive='clip')

Additional information

I'm not sure if this is really a bug or if it's just a confusing / rough edge. The scale/transform API is fairly cumbersome, but improving that situation is a big project. Is the transform you set with axis.set_transform ever actually used? If not, then maybe set_transform should not exist (or it should raise if called)?

Matplotlib Version

3.5.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.