Open
Description
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