forked from matplotlib/matplotlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MNT: Deprecate changing Figure.number
Historically, pyplot dynamically added a number attribute to figure. However, this number must stay in sync with the figure manger. AFAICS overwriting the number attribute does not have the desired effect for pyplot. But there are some repos in GitHub that do change number. So let's take it slow and properly migrate away from writing. Making the dynamic attribute private and wrapping it in a property allows to maintain current behavior and deprecate write-access. When the deprecation expires, there's no need for duplicate state anymore and the private _number attribute can be replaced by `self.canvas.manager.num` if that exists and None otherwise. Also closes matplotlib#28994.
- Loading branch information
Showing
5 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Changing ``Figure.number`` | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Changing ``Figure.number`` is deprecated. This value is used by `.pyplot` | ||
to identify figures. It must stay in sync with the pyplot internal state | ||
and is not intended to be modified by the user. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters