- Figure.show(dpi=300, width=500, method=None, waiting=0.5, **kwargs)
Display a preview of the figure.
Inserts the preview in the Jupyter notebook output if available, otherwise opens it in the default viewer for your operating system (falls back to the default web browser).
pygmt.set_displaycan select the default display method (
methodparameter can also override the default display method for the current figure. Parameters
widthcan be used to control the resolution and dimension of the figure in the notebook.
Note: The external viewer can be disabled by setting the PYGMT_USE_EXTERNAL_DISPLAY environment variable to false. This is useful when running unit tests and building the documentation in consoles without a Graphical User Interface.
Note that the external viewer does not block the current process, thus it’s necessary to suspend the execution of the current process for a short while after launching the external viewer, so that the preview image won’t be deleted before the external viewer tries to open it. Set the
waitingparameter to a larger number if your computer is slow.
dpi (int) – The image resolution (dots per inch) in Jupyter notebooks.
width (int) – The image width (in pixels) in Jupyter notebooks.
method (str or None) –
How the current figure will be displayed. Choose from:
"external": External PDF preview using the default PDF viewer
"notebook": Inline PNG preview in the current notebook
"none": Disable image preview
None: Reset to the default display method
The default display method is
"external"in Python consoles or
"notebook"in Jupyter notebooks, but can be changed by
waiting (float) – Suspend the execution of the current process for a given number of seconds after launching an external viewer. Only works if