, dpi=300, width=500, method='static')[source]

Display a preview of the figure.

Inserts the preview in the Jupyter notebook output. You will need to have IPython installed for this to work. You should have it if you are using the notebook.

If method='external', makes PDF preview instead and opens it in the default viewer for your operating system (falls back to the default web browser). Note that the external viewer does not block the current process, so this won’t work in a script.

dpi : int

The image resolution (dots per inch).

width : int

Width of the figure shown in the notebook in pixels. Ignored if method='external'.

method : str

How the figure will be displayed. Options are (1) 'static': PNG preview (default); (2) 'external': PDF preview in an external program.

img : IPython.display.Image

Only if method != 'external'.