pygmt.Figure.ternary

Figure.ternary(data, alabel=None, blabel=None, clabel=None, frame=False, region=None, verbose=False, panel=False, transparency=None, perspective=False, **kwargs)

Plot data on ternary diagrams.

Reads (a,b,c[,z]) records from data and plots symbols at those locations on a ternary diagram. If a symbol is selected and no symbol size given, then we will interpret the fourth column of the input data as symbol size. Symbols whose size is <= 0 are skipped. If no symbols are specified then the symbol code (see style below) must be present as last column in the input. If style is not specified then we instead plot lines or polygons.

Full GMT docs at https://docs.generic-mapping-tools.org/6.6/ternary.html.

Aliases:

  • C = cmap

  • G = fill

  • JX = width

  • S = style

  • W = pen

  • B = frame

  • L = alabel/blabel/clabel

  • R = region

  • V = verbose

  • c = panel

  • p = perspective

  • t = transparency

Parameters:
  • data (str | PathLike | dict | ndarray | DataFrame | Dataset | GeoDataFrame) – Pass in either a file name to an ASCII data table, a Python list, a 2-D numpy.ndarray, a pandas.DataFrame, an xarray.Dataset made up of 1-D xarray.DataArray data variables, or a geopandas.GeoDataFrame containing the tabular data.

  • width (str) – Set the width of the figure by passing a number, followed by a unit (i for inches, c for centimeters). Use a negative width to indicate that positive axes directions be clock-wise [Default lets the a, b, c axes be positive in a counter-clockwise direction].

  • region (str or list) – [amin, amax, bmin, bmax, cmin, cmax]. Give the min and max limits for each of the three axes a, b, and c.

  • cmap (str) – File name of a CPT file or a series of comma-separated colors (e.g., color1,color2,color3) to build a linear continuous CPT from those colors automatically.

  • fill (str) – Set color or pattern for filling symbols or polygons [Default is no fill].

  • alabel (str | None, default: None) – Set the label for the a vertex where the component is 100%. The label is placed at a distance of three times the MAP_LABEL_OFFSET setting from the corner.

  • blabel (str | None, default: None) – Same as alabel but for the b vertex.

  • clabel (str | None, default: None) – Same as alabel but for the c vertex.

  • style (str) – symbol[size]. Plot individual symbols in a ternary diagram.

  • pen (str) – Set pen attributes for lines or the outline of symbols.

  • verbose (bool or str) – Select verbosity level [Full usage].

  • panel (int | Sequence[int] | bool, default: False) –

    Select a specific subplot panel. Only allowed when used in Figure.subplot mode.

    • True to advance to the next panel in the selected order.

    • index to specify the index of the desired panel.

    • (row, col) to specify the row and column of the desired panel.

    The panel order is determined by the Figure.subplot method. row, col and index all start at 0.

  • perspective (float | Sequence[float] | str | bool, default: False) –

    Select perspective view and set the azimuth and elevation of the viewpoint.

    Accepts a single value or a sequence of two or three values: azimuth, (azimuth, elevation), or (azimuth, elevation, zlevel).

    • azimuth: Azimuth angle of the viewpoint in degrees [Default is 180, i.e., looking from south to north].

    • elevation: Elevation angle of the viewpoint above the horizon [Default is 90, i.e., looking straight down at nadir].

    • zlevel: Z-level at which 2-D elements (e.g., the map frame) are drawn. Only applied when used together with zsize or zscale. [Default is at the bottom of the z-axis].

    Alternatively, set perspective=True to reuse the perspective setting from the previous plotting method, or pass a string following the full GMT syntax for finer control (e.g., adding +w or +v modifiers to select an axis location other than the plot origin). See https://docs.generic-mapping-tools.org/6.6/gmt.html#perspective-full for details.

  • transparency (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.ternary

Ternary diagram

Ternary diagram

Bit and hachure patterns

Bit and hachure patterns