- Figure.show(dpi=300, width=500, method=None, waiting=0.5)
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 (notebook, external, or none).
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) –
How the current figure will be displayed. Options are
external: PDF preview in an external program [default]
notebook: PNG preview [default in Jupyter notebooks]
none: Disable image preview
waiting (float) – Suspend the execution of the current process for a given number of seconds after launching an external viewer. Only works if