pygmt.Figure.plot3d

Figure.plot3d(x=None, y=None, z=None, data=None, sizes=None, direction=None, **kwargs)

Plot lines, polygons, and symbols in 3-D

Takes a matrix, (x,y,z) triplets, or a file name as input and plots lines, polygons, or symbols at those locations in 3-D.

Must provide either data or x, y and z.

If providing data through x, y and z, color can be a 1d array that will be mapped to a colormap.

If a symbol is selected and no symbol size given, then plot3d 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 used, a line connecting the data points will be drawn instead. To explicitly close polygons, use close. Select a fill with color. If color is set, pen will control whether the polygon outline is drawn or not. If a symbol is selected, color and pen determines the fill and outline/no outline, respectively.

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

Aliases:

  • A = straight_lines

  • B = frame

  • C = cmap

  • D = position

  • E = error_bars

  • G = color

  • J = projection

  • JZ = zsize

  • Jz = zscale

  • L = close

  • R = region

  • S = style

  • W = pen

  • i = columns

  • l = label

  • p = perspective

Parameters
  • x/y/z (float or 1d arrays) – The x, y, and z coordinates, or arrays of x, y and z coordinates of the data points

  • data (str or 2d array) – Either a data file name or a 2d numpy array with the tabular data. Use option columns (i) to choose which columns are x, y, z, color, and size, respectively.

  • sizes (1d array) – The sizes of the data points in units specified in style (S). Only valid if using x, y and z.

  • direction (list of two 1d arrays) – If plotting vectors (using style='V' or style='v'), then should be a list of two 1d arrays with the vector directions. These can be angle and length, azimuth and length, or x and y components, depending on the style options chosen.

  • projection (str) – Required if this is the first plot command. Select map projection.

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

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

  • straight_lines (bool or str) – '[m|p|x|y]' By default, geographic line segments are drawn as great circle arcs. To draw them as straight lines, use A.

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

  • cmap (str) – File name of a CPT file or C='color1,color2[,color3,...]' to build a linear continuous CPT from those colors automatically.

  • position (str) – 'dx/dy': Offset the plot symbol or line locations by the given amounts dx/dy.

  • error_bars (bool or str) – '[x|y|X|Y][+a][+cl|f][+n][+wcap][+ppen]'. Draw symmetrical error bars.

  • color (str) – Select color or pattern for filling of symbols or polygons. Default is no fill.

  • style (str) – Plot symbols (including vectors, pie slices, fronts, decorated or quoted lines).

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

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

  • columns (list or str) – cols[+l][+sscale][+ooffset][,…][,t[word]] Select input columns and transformations (0 is first column, t is trailing text, append word to read one word only).

  • label (str) – Add a legend entry for the symbol or line being plotted.

  • perspective (list or str) – '[x|y|z]azim[/elev[/zlevel]][+wlon0/lat0[/z0]][+vx0/y0]'. Select perspective view.