8000 Merge pull request #27777 from meeseeksmachine/auto-backport-of-pr-27… · matplotlib/matplotlib@87a52b5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 87a52b5

Browse files
authored
Merge pull request #27777 from meeseeksmachine/auto-backport-of-pr-27776-on-v3.8.x
Backport PR #27776 on branch v3.8.x (Better document the relation between figure and manager)
2 parents 4591c5b + ae7a8dc commit 87a52b5

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2584,9 +2584,13 @@ class FigureManagerBase:
25842584
backend-independent way. It's an adapter for the real (GUI) framework that
25852585
represents the visual figure on screen.
25862586
2587-
GUI backends define from this class to translate common operations such
2587+
The figure manager is connected to a specific canvas instance, which in turn
2588+
is connected to a specific figure instance. To access a figure manager for
2589+
a given figure in user code, you typically use ``fig.canvas.manager``.
2590+
2591+
GUI backends derive from this class to translate common operations such
25882592
as *show* or *resize* to the GUI-specific code. Non-GUI backends do not
2589-
support these operations an can just use the base class.
2593+
support these operations and can just use the base class.
25902594
25912595
This following basic operations are accessible:
25922596
@@ -2771,6 +2775,11 @@ def set_window_title(self, title):
27712775
Set the title text of the window containing the figure.
27722776
27732777
This has no effect for non-GUI (e.g., PS) backends.
2778+
2779+
Examples
2780+
--------
2781+
>>> fig = plt.figure()
2782+
>>> fig.canvas.manager.set_window_title('My figure')
27742783
"""
27752784

27762785

0 commit comments

Comments
 (0)
0