pygmt.Figure.show

Figure.show(dpi=300, width=500, method=None, waiting=0.5)[source]

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_display can select the default display method (notebook, external, or none).

The method parameter can also override the default display method for the current figure. Parameters dpi and width can 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 waiting parameter to a larger number if your computer is slow.

Parameters
  • 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 method="external".

Examples using pygmt.Figure.show

Color land and water

Color land and water

Color land and water
Political Boundaries

Political Boundaries

Political Boundaries
Shorelines

Shorelines

Shorelines
Cartesian, circular, and geographic vectors

Cartesian, circular, and geographic vectors

Cartesian, circular, and geographic vectors
Generate points along great circles

Generate points along great circles

Generate points along great circles
Line colors with a custom CPT

Line colors with a custom CPT

Line colors with a custom CPT
Line fronts

Line fronts

Line fronts
Line styles

Line styles

Line styles
Roads

Roads

Roads
Vector heads and tails

Vector heads and tails

Vector heads and tails
Wiggle along tracks

Wiggle along tracks

Wiggle along tracks
Basic geometric symbols

Basic geometric symbols

Basic geometric symbols
Color points by categories

Color points by categories

Color points by categories
Custom symbols

Custom symbols

Custom symbols
Datetime inputs

Datetime inputs

Datetime inputs
Multi-parameter symbols

Multi-parameter symbols

Multi-parameter symbols
Points

Points

Points
Points with varying transparency

Points with varying transparency

Points with varying transparency
Scatter plots with a legend

Scatter plots with a legend

Scatter plots with a legend
Text symbols

Text symbols

Text symbols
Calculating grid gradient and radiance

Calculating grid gradient and radiance

Calculating grid gradient and radiance
Clipping grid values

Clipping grid values

Clipping grid values
Contours

Contours

Contours
Create 'wet-dry' mask grid

Create ‘wet-dry’ mask grid

Create 'wet-dry' mask grid
Images on figures

Images on figures

Images on figures
Sampling along tracks

Sampling along tracks

Sampling along tracks
3D Scatter plots

3D Scatter plots

3D Scatter plots
Plotting a surface

Plotting a surface

Plotting a surface
Focal mechanisms

Focal mechanisms

Focal mechanisms
Velocity arrows and confidence ellipses

Velocity arrows and confidence ellipses

Velocity arrows and confidence ellipses
Double Y axes graph

Double Y axes graph

Double Y axes graph
Blockmean

Blockmean

Blockmean
Histogram

Histogram

Histogram
Rose diagram

Rose diagram

Rose diagram
Colorbar

Colorbar

Colorbar
Day-night terminator line and twilights

Day-night terminator line and twilights

Day-night terminator line and twilights
Inset

Inset

Inset
Inset map showing a rectangular region

Inset map showing a rectangular region

Inset map showing a rectangular region
Legend

Legend

Legend
Logo

Logo

Logo
Multiple colormaps

Multiple colormaps

Multiple colormaps
Coastlines and borders

Coastlines and borders

Coastlines and borders
Frames, ticks, titles, and labels

Frames, ticks, titles, and labels

Frames, ticks, titles, and labels
Plotting data points

Plotting data points

Plotting data points
Plotting lines

Plotting lines

Plotting lines
Plotting text

Plotting text

Plotting text
Setting the region

Setting the region

Setting the region
Adding an inset to the figure

Adding an inset to the figure

Adding an inset to the figure
Configuring PyGMT defaults

Configuring PyGMT defaults

Configuring PyGMT defaults
Creating a 3D perspective image

Creating a 3D perspective image

Creating a 3D perspective image
Creating a map with contour lines

Creating a map with contour lines

Creating a map with contour lines
Making subplots

Making subplots

Making subplots
Performing grid histogram equalization

Performing grid histogram equalization

Performing grid histogram equalization
Plotting Earth relief

Plotting Earth relief

Plotting Earth relief
Plotting datetime charts

Plotting datetime charts

Plotting datetime charts
Plotting vectors

Plotting vectors

Plotting vectors
1. Making your first figure

1. Making your first figure

1. Making your first figure
Azimuthal Equidistant

Azimuthal Equidistant

Azimuthal Equidistant
General Perspective

General Perspective

General Perspective
General Stereographic

General Stereographic

General Stereographic
Gnomonic

Gnomonic

Gnomonic
Lambert Azimuthal Equal Area

Lambert Azimuthal Equal Area

Lambert Azimuthal Equal Area
Orthographic

Orthographic

Orthographic
Albers Conic Equal Area

Albers Conic Equal Area

Albers Conic Equal Area
Equidistant conic

Equidistant conic

Equidistant conic
Lambert Conic Conformal Projection

Lambert Conic Conformal Projection

Lambert Conic Conformal Projection
Polyconic Projection

Polyconic Projection

Polyconic Projection
Cassini Cylindrical

Cassini Cylindrical

Cassini Cylindrical
Cylindrical Stereographic

Cylindrical Stereographic

Cylindrical Stereographic
Cylindrical equal-area

Cylindrical equal-area

Cylindrical equal-area
Cylindrical equidistant

Cylindrical equidistant

Cylindrical equidistant
Mercator

Mercator

Mercator
Miller cylindrical

Miller cylindrical

Miller cylindrical
Oblique Mercator

Oblique Mercator

Oblique Mercator
Oblique Mercator

Oblique Mercator

Oblique Mercator
Oblique Mercator

Oblique Mercator

Oblique Mercator
Transverse Mercator

Transverse Mercator

Transverse Mercator
Universal Transverse Mercator

Universal Transverse Mercator

Universal Transverse Mercator
Eckert IV

Eckert IV

Eckert IV
Eckert VI

Eckert VI

Eckert VI
Hammer

Hammer

Hammer
Mollweide

Mollweide

Mollweide
Robinson

Robinson

Robinson
Sinusoidal

Sinusoidal

Sinusoidal
Van der Grinten

Van der Grinten

Van der Grinten
Winkel Tripel

Winkel Tripel

Winkel Tripel
Cartesian linear

Cartesian linear

Cartesian linear
Cartesian logarithmic

Cartesian logarithmic

Cartesian logarithmic
Cartesian power

Cartesian power

Cartesian power
Polar

Polar

Polar