pygmt.Figure.basemap

Figure.basemap(*, region=None, projection=None, zscale=None, zsize=None, frame=None, map_scale=None, box=None, rose=None, compass=None, timestamp=None, verbose=None, panel=None, coltypes=None, perspective=None, transparency=None, **kwargs)

Plot base maps and frames for the figure.

Creates a basic or fancy basemap with axes, fill, and titles. Several map projections are available, and the user may specify separate tick-mark intervals for boundary annotation, ticking, and [optionally] gridlines. A simple map scale or directional rose may also be plotted.

Full option list at https://docs.generic-mapping-tools.org/latest/basemap.html

Aliases:

  • B = frame

  • F = box

  • J = projection

  • JZ = zsize

  • Jz = zscale

  • L = map_scale

  • R = region

  • Td = rose

  • Tm = compass

  • U = timestamp

  • V = verbose

  • c = panel

  • f = coltypes

  • p = perspective

  • t = transparency

Parameters
  • projection (str) – projcode[projparams/]width. Select map projection.

  • zscale/zsize (float or str) – Set z-axis scaling or z-axis size.

  • region (str or list) – xmin/xmax/ymin/ymax[+r][+uunit]. Specify the region of interest. Required if this is the first plot command.

  • frame (bool or str or list) – Set map boundary frame and axes attributes.

  • map_scale (str) – [g|j|J|n|x]refpoint+wlength. Draws a simple map scale centered on the reference point specified.

  • box (bool or str) – [+cclearances][+gfill][+i[[gap/]pen]][+p[pen]][+r[radius]][+s[[dx/dy/][shade]]]. If set to True, draws a rectangular border around the map scale or rose. Alternatively, specify a different pen with +ppen. Add +gfill to fill the scale panel [Default is no fill]. Append +cclearance where clearance is either gap, xgap/ygap, or lgap/rgap/bgap/tgap where these items are uniform, separate in x- and y-direction, or individual side spacings between scale and border. Append +i to draw a secondary, inner border as well. We use a uniform gap between borders of 2p and the MAP_DEFAULTS_PEN unless other values are specified. Append +r to draw rounded rectangular borders instead, with a 6p corner radius. You can override this radius by appending another value. Finally, append +s to draw an offset background shaded region. Here, dx/dy indicates the shift relative to the foreground frame [Default is 4p/-4p] and shade sets the fill style to use for shading [Default is gray50].

  • rose (str) – Draws a map directional rose on the map at the location defined by the reference and anchor points.

  • compass (str) – Draws a map magnetic rose on the map at the location defined by the reference and anchor points

  • timestamp (bool or str) – Draw GMT time stamp logo on plot.

  • verbose (bool or str) –

    Select verbosity level [Default is w], which modulates the messages written to stderr. Choose among 7 levels of verbosity:

    • q - Quiet, not even fatal error messages are produced

    • e - Error messages only

    • w - Warnings [Default]

    • t - Timings (report runtimes for time-intensive algorithms)

    • i - Informational messages (same as verbose=True)

    • c - Compatibility warnings

    • d - Debugging messages

  • panel (bool or int or list) – [row,col|index]. Select a specific subplot panel. Only allowed when in subplot mode. Use panel=True to advance to the next panel in the selected order. Instead of row,col you may also give a scalar value index which depends on the order you set via autolabel when the subplot was defined. Note: row, col, and index all start at 0.

  • coltypes (str) – [i|o]colinfo. Specify data types of input and/or output columns (time or geographical data). Full documentation is at https://docs.generic-mapping-tools.org/latest/gmt.html#f-full.

  • perspective (list or str) – [x|y|z]azim[/elev[/zlevel]][+wlon0/lat0[/z0]][+vx0/y0]. Select perspective view and set the azimuth and elevation angle of the viewpoint. Default is [180, 90]. Full documentation is at https://docs.generic-mapping-tools.org/latest/gmt.html#perspective-full.

  • transparency (int or float) – Set transparency level, in [0-100] percent range [Default is 0, i.e., opaque]. Only visible when PDF or raster format output is selected. Only the PNG format selection adds a transparency layer in the image (for further processing).

Examples using pygmt.Figure.basemap

Color land and water

Color land and water

Color land and water
Political Boundaries

Political Boundaries

Political Boundaries
Shorelines

Shorelines

Shorelines
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
Vertical or horizontal bars

Vertical or horizontal bars

Vertical or horizontal bars
Clipping grid values

Clipping grid values

Clipping grid values
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
Double Y axes graph

Double Y axes graph

Double Y axes graph
Colorbar

Colorbar

Colorbar
Inset map showing a rectangular region

Inset map showing a rectangular region

Inset map showing a rectangular region
Legend

Legend

Legend
Logo

Logo

Logo
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 text

Plotting text

Plotting text
Configuring PyGMT defaults

Configuring PyGMT defaults

Configuring PyGMT defaults
Making subplots

Making subplots

Making subplots
Polar

Polar

Polar