gmt.Figure.show

Figure.show(dpi=300, width=500, method='static', globe_center=None)[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.

If using the 'globe' preview, use a Cartesian projection ('X') and specify degrees as size units (e.g. projection='X3id/3id'). Otherwise, the figure may not align with the globe.

Parameters:
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; (3) 'globe': interactive 3D globe in the notebook using NASA WorldWind Web (only use if plotting lon/lat data).

globe_center : None or tuple = (lon, lat, height[m])

The coordinates used to set the view point for the globe preview. If None, will automatically determine a view based on the plot region. Only used if method='globe'.

Returns:
img : IPython.display.Image or IPython.display.Javascript

Only if method != 'external'.