matplotlib.figure.Figure.show#

Figure.show(warn=True)[source]#

If using a GUI backend with pyplot, display the figure window.

If the figure was not created usingfigure, it will lackaFigureManagerBase, and this method will raise anAttributeError.

Warning

This does not manage an GUI event loop. Consequently, the figuremay only be shown briefly or not shown at all if you or yourenvironment are not managing an event loop.

Use cases forFigure.show include running this from a GUIapplication (where there is persistently an event loop running) orfrom a shell, like IPython, that install an input hook to allow theinteractive shell to accept input while the figure is also beingshown and interactive. Some, but not all, GUI toolkits willregister an input hook on import. SeeCommand prompt integration formore details.

If you're in a shell without input hook integration or executing apython script, you should usematplotlib.pyplot.show withblock=True instead, which takes care of starting and runningthe event loop for you.

Parameters:
warnbool, default: True

IfTrue and we are not running headless (i.e. on Linux with anunset DISPLAY), issue warning when called on a non-GUI backend.

Examples usingmatplotlib.figure.Figure.show#

Polygon Selector

Polygon Selector