pygmt.Figure.wiggle¶
- Figure.wiggle(x=None, y=None, z=None, data=None, *, frame=None, position=None, color=None, projection=None, region=None, track=None, timestamp=None, verbose=None, pen=None, xshift=None, yshift=None, scale=None, binary=None, panel=None, nodata=None, find=None, gap=None, header=None, columns=None, perspective=None, **kwargs)¶
Plot z=f(x,y) anomalies along tracks.
Takes a matrix, (x,y,z) triplets, or a file name as input and plots z as a function of distance along track.
Must provide either
data
orx
/y
/z
.Full parameter list at https://docs.generic-mapping-tools.org/latest/wiggle.html
Aliases:
B = frame
D = position
G = color
J = projection
R = region
T = track
U = timestamp
V = verbose
W = pen
X = xshift
Y = yshift
Z = scale
b = binary
c = panel
d = nodata
e = find
g = gap
h = header
i = columns
p = perspective
- Parameters
x/y/z (1d arrays) – The arrays of x and y coordinates and z data points.
data (str or numpy.ndarray or pandas.DataFrame or xarray.Dataset or geopandas.GeoDataFrame) – Pass in either a file name to an ASCII data table, a 2D
numpy.ndarray
, apandas.DataFrame
, anxarray.Dataset
made up of 1Dxarray.DataArray
data variables, or ageopandas.GeoDataFrame
containing the tabular data. Use parametercolumns
to choose which columns are x, y, z, respectively.projection (str) – Required if this is the first plot command. projcode[projparams/]width. Select map projection.
region (str or list) – Required if this is the first plot command. xmin/xmax/ymin/ymax[+r][+uunit]. Specify the region of interest.
scale (str or float) – Gives anomaly scale in data-units/distance-unit. Append c, i, or p to indicate the distance unit (cm, inch, or point); if no unit is given we use the default unit that is controlled by PROJ_LENGTH_UNIT.
frame (bool or str or list) – Set map boundary frame and axes attributes.
position (str) – [g|j|J|n|x]refpoint+wlength[+jjustify][+al|r][+odx[/dy]][+l[label]]. Defines the reference point on the map for the vertical scale bar.
color (str) – Set fill shade, color or pattern for positive and/or negative wiggles [Default is no fill]. Optionally, append +p to fill positive areas (this is the default behavior). Append +n to fill negative areas. Append +n+p to fill both positive and negative areas with the same fill. Note: You will need to repeat the color parameter to select different fills for the positive and negative wiggles.
track (str) – Draw track [Default is no track]. Append pen attributes to use [Default is 0.25p,black,solid].
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
pen (str) – Specify outline pen attributes [Default is no outline].
xshift (str) – [a|c|f|r][xshift]. Shift plot origin in x-direction.
yshift (str) – [a|c|f|r][yshift]. Shift plot origin in y-direction. Full documentation is at https://docs.generic-mapping-tools.org/latest/gmt.html#xy-full.
i|o[ncols][type][w][+l|b]. Select native binary input (using
binary="i"
) or output (usingbinary="o"
), where ncols is the number of data columns of type, which must be one of:c - int8_t (1-byte signed char)
u - uint8_t (1-byte unsigned char)
h - int16_t (2-byte signed int)
H - uint16_t (2-byte unsigned int)
i - int32_t (4-byte signed int)
I - uint32_t (4-byte unsigned int)
l - int64_t (8-byte signed int)
L - uint64_t (8-byte unsigned int)
f - 4-byte single-precision float
d - 8-byte double-precision float
x - use to skip ncols anywhere in the record
For records with mixed types, append additional comma-separated combinations of ncols type (no space). The following modifiers are supported:
w after any item to force byte-swapping.
+l|b to indicate that the entire data file should be read as little- or big-endian, respectively.
Full documentation is at https://docs.generic-mapping-tools.org/latest/gmt.html#bi-full.
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 viaautolabel
when the subplot was defined. Note: row, col, and index all start at 0.nodata (str) – i|onodata. Substitute specific values with NaN (for tabular data). For example,
d="-9999"
will replace all values equal to -9999 with NaN during input and all NaN values with -9999 during output. Prepend i to the nodata value for input columns only. Prepend o to the nodata value for output columns only.find (str) – [~]“pattern” | [~]/regexp/[i]. Only pass records that match the given pattern or regular expressions [Default processes all records]. Prepend ~ to the pattern or regexp to instead only pass data expressions that do not match the pattern. Append i for case insensitive matching. This does not apply to headers or segment headers.
[a]x|y|d|X|Y|D|[col]zgap[+n|p]. Examine the spacing between consecutive data points in order to impose breaks in the line. To specify multiple critera, provide a list with each item containing a string describing one set of critera. Prepend a to specify that all the criteria must be met [Default is to impose breaks if any criteria are met]. The following modifiers are supported:
x|X - define a gap when there is a large enough change in the x coordinates (upper case to use projected coordinates).
y|Y - define a gap when there is a large enough change in the y coordinates (upper case to use projected coordinates).
d|D - define a gap when there is a large enough distance between coordinates (upper case to use projected coordinates).
[col]z - define a gap when there is a large enough change in the data in column col [default col is 2 (i.e., 3rd column)].
A unit u may be appended to the specified gap:
For geographic data (x|y|d), the unit may be arc d(egree), m(inute), and s(econd), or (m)e(ter), f(eet), k(ilometer), M(iles), or n(autical miles) [Default is (m)e(ter)].
For projected data (X|Y|D), the unit may be i(nch), c(entimeter), or p(oint).
One of the following modifiers can be appended to gap [Default imposes breaks based on the absolute value of the difference between the current and previous value]:
+n - specify that the previous value minus the current column value must exceed gap for a break to be imposed.
+p - specify that the current value minus the previous value must exceed gap for a break to be imposed.
header (str) –
[i|o][n][+c][+d][+msegheader][+rremark][+ttitle]. Specify that input and/or output file(s) have n header records [Default is 0]. Prepend i if only the primary input should have header records. Prepend o to control the writing of header records, with the following modifiers supported:
+d to remove existing header records.
+c to add a header comment with column names to the output [Default is no column names].
+m to add a segment header segheader to the output after the header block [Default is no segment header].
+r to add a remark comment to the output [Default is no comment]. The remark string may contain \n to indicate line-breaks.
+t to add a title comment to the output [Default is no title]. The title string may contain \n to indicate line-breaks.
Blank lines and lines starting with # are always skipped.
columns (str or 1d array) – Choose which columns are x, y, and z, respectively if input is provided via data. E.g.
columns = [0, 1, 2]
orcolumns = "0,1,2"
if the x values are stored in the first column, y values in the second one and z values in the third one. Note: zero-based indexing is used.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.