How can I set a figure window's title in pylab/python?
fig = figure(9) # 9 is now the title of the window fig.set_title("Test") #doesn't work fig.title = "Test" #doesn't work
PyLab is a procedural interface to the Matplotlib object-oriented plotting library. Matplotlib is the whole package; matplotlib. pyplot is a module in Matplotlib; and PyLab is a module that gets installed alongside Matplotlib. PyLab is a convenience module that bulk imports matplotlib.
For all backends, the window size is controlled by the figsize argument. In general, for any matplotlib figure object, you can also call fig. set_size_inches((width, height)) to change the size of the figure.
If you want to actually change the window you can do:
fig = pylab.gcf() fig.canvas.set_window_title('Test')
Update 2021-05-15:
The solution above is deprecated (see here). instead use
fig = pylab.gcf() fig.canvas.manager.set_window_title('Test')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With