Bug summary
canvas.manager.set_window_title does not work to figure with WebAgg backend (but MacOSX). the title is still Figure 1 by default.
Code for reproduction
import matplotlib.pyplot as plt
import numpy as np
import matplotlib
matplotlib.use("WebAgg")
fig = plt.figure(figsize=(7, 5))
fig.canvas.manager.set_window_title("My figure")
ax = fig.add_subplot(111)
dx, dy = 0.05, 0.05
y, x = np.mgrid[slice(1, 5 + dy, dy),
slice(1, 5 + dx, dx)]
z = np.sin(x)**10 + np.cos(10 + y*x) * np.cos(x)
cf = ax.contourf(x + dx/2., y + dy/2., z)
fig.colorbar(cf, ax=ax)
plt.show()
Actual outcome
Expected outcome
Additional information
it works in MacOSX backends
Operating system
macOS Sequoia 15.1.1
Matplotlib Version
3.9.3
Matplotlib Backend
WebAgg
Python version
3.12.7
Jupyter version
No response
Installation
pip