You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MatplotlibDeprecationWarning:
The figbox attribute was deprecated in Matplotlib 3.4 and will be removed two minor releases later. Use get_subplotspec().get_position(self.figure) instead.
Expected outcome
A useful suggestion. I could not make sense from the deprecation or the documentation on how this was supposed to be replaced. I have no idea what object self.figure refers to, or even in what module get_subplotspec lives.
Matplotlib version
Operating system: Fedora 33
Matplotlib version (import matplotlib; print(matplotlib.__version__)): 3.4.1
but unfortunately this does not give the same result as was returned by ax.figbox for at least a decade until matplotlib 3.4.x. Since version 3.4 figbox now also returns the same value as suggested as replacement in the message. Whoever changed this in 3.4 broke it. I will submit a separate regression.
I have opened a PR to improve the messages; if you could open a separate issue for the difference in output between the two commands that would be helpful 👍
If you update the deprecation warning message in a PR, please suggest as deprecation warning to replace ax.figbox by BboxTransformFrom(ax.figure.bbox).transform_bbox(ax.bbox).
My personal view, however, is that you should just retain the figbox in ax - why not?
If you want the position, in figure-normalized units, that is the way to get it. I didn't even know figbox existed before this thread. I'll close, but feel free to ask for a re-open if this doesn't help.
Activity
jklymak commentedon Apr 11, 2021
Please try
ax.get_subplotspec().get_position(self.figure)? Out of curiosity, what do you needfigboxfor?dstansby commentedon Apr 11, 2021
Should that be
ax.get_subplotspec().get_position(ax.figure)? (noteself>ax) If so I think the message could be clearer by usingaxinstead ofself.2sn commentedon Apr 16, 2021
yes, I can call
but unfortunately this does not give the same result as was returned by ax.figbox for at least a decade until
matplotlib3.4.x. Since version 3.4 figbox now also returns the same value as suggested as replacement in the message. Whoever changed this in 3.4 broke it. I will submit a separate regression.Example from 3.3.4
Example form 3.4.1
dstansby commentedon Apr 16, 2021
I have opened a PR to improve the messages; if you could open a separate issue for the difference in output between the two commands that would be helpful 👍
2sn commentedon Apr 16, 2021
related to #19982
2sn commentedon Apr 16, 2021
If you update the deprecation warning message in a PR, please suggest as deprecation warning to replace
ax.figboxbyBboxTransformFrom(ax.figure.bbox).transform_bbox(ax.bbox).My personal view, however, is that you should just retain the
figboxinax- why not?2sn commentedon Apr 16, 2021
update from #19982 - maybe
ax.get_position()will do.jklymak commentedon Apr 16, 2021
If you want the position, in figure-normalized units, that is the way to get it. I didn't even know
figboxexisted before this thread. I'll close, but feel free to ask for a re-open if this doesn't help.tacaswell commentedon May 15, 2021
Did we actually fix the deprecation warning to point at the correct method?
jklymak commentedon May 15, 2021
I sorry I'd misunderstood.
2sn commentedon May 16, 2021
As of 3.4.2 I see no change relative to 3.4.0.
What I would have proposed is two items:
ax.get_position())ax.get_position()[-]unuseful deprecation warning figbox[/-][+]useless deprecation warning figbox[/+]