Use set_window_title rather than set_label to set title of webagg figure #29338
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #29256.
Previously when using the
webagg
backend if you wanted to change the title above a figure you would usefigure.set_label('whatever')
and if you usedfigure.canvas.manager.set_window_title('whatever')
it would be ignored. This was inconsistent with other backends which use the latter.This PR changes the behaviour so that
figure.canvas.manager.set_window_title('whatever')
is used now forwebagg
, the same as the other backends.There is no test as there isn't currently any visual testing of the
webagg
backend. There is some draft work underway in #23540 for this. So here is a demonstration instead, using this code:the
webagg
output is:which is consistent with the output produced by e.g. the
qtagg
backend:PR checklist
WebAgg
backend #29256" is in the body of the PR description to link the related issue