Skip to content

Navigation Menu

Sign in
Appearance settings

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

Sign up
Appearance settings

Commit 767979e

Browse files
Use set_window_title rather than set_label to set title of webagg figure
1 parent f8900ea commit 767979e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Setting titles of figures using webagg backend
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
Previously when using the ``webagg`` backend the title of a figure was set using
5+
``figure.set_label``. Now it is set using ``figure.canvas.manager.set_window_title``
6+
which is more consistent with other backends.

‎lib/matplotlib/backends/backend_webagg_core.py‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,8 @@ def handle_toolbar_button(self, event):
328328
getattr(self.toolbar, event['name'])()
329329

330330
def handle_refresh(self, event):
331-
figure_label = self.figure.get_label()
332-
if not figure_label:
333-
figure_label = f"Figure {self.manager.num}"
334-
self.send_event('figure_label', label=figure_label)
331+
if self.manager:
332+
self.send_event('figure_label', label=self.manager.get_window_title())
335333
self._force_full = True
336334
if self.toolbar:
337335
# Normal toolbar init would refresh this, but it happens before the

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /