diff --git a/pygmt/helpers/decorators.py b/pygmt/helpers/decorators.py index a691320be86..529e8047dd6 100644 --- a/pygmt/helpers/decorators.py +++ b/pygmt/helpers/decorators.py @@ -6,6 +6,7 @@ """ import functools +import string import textwrap import warnings from inspect import Parameter, signature @@ -410,11 +411,11 @@ def fmt_docstring(module_func): ... ---------- ... data ... Pass in either a file name to an ASCII data table, a 2-D - ... {table-classes}. - ... {region} - ... {projection} + ... $table_classes. + ... $region + ... $projection ... - ... {aliases} + ... $aliases ... ''' ... pass >>> print(gmtinfo.__doc__) @@ -456,7 +457,7 @@ def fmt_docstring(module_func): aliases.append(f" - {arg} = {alias}") filler_text["aliases"] = "\n".join(aliases) - filler_text["table-classes"] = ( + filler_text["table_classes"] = ( ":class:`numpy.ndarray`, a :class:`pandas.DataFrame`, an\n" " :class:`xarray.Dataset` made up of 1-D :class:`xarray.DataArray`\n" " data variables, or a :class:`geopandas.GeoDataFrame` containing the\n" @@ -471,8 +472,7 @@ def fmt_docstring(module_func): # Dedent the docstring to make it all match the option text. docstring = textwrap.dedent(module_func.__doc__) - module_func.__doc__ = docstring.format(**filler_text) - + module_func.__doc__ = string.Template(docstring).safe_substitute(**filler_text) return module_func diff --git a/pygmt/src/basemap.py b/pygmt/src/basemap.py index 1e1270d96e9..8c264f4f3e5 100644 --- a/pygmt/src/basemap.py +++ b/pygmt/src/basemap.py @@ -45,7 +45,7 @@ def basemap( Full GMT docs at :gmt-docs:`basemap.html`. - {aliases} + $aliases - B = frame - J = projection - Jz = zscale @@ -58,12 +58,12 @@ def basemap( Parameters ---------- - {projection} + $projection zscale/zsize Set z-axis scaling or z-axis size. - {region} + $region *Required if this is the first plot command.* - {frame} + $frame map_scale : str [**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\ **+w**\ *length*. @@ -92,11 +92,11 @@ def basemap( compass : str Draw a map magnetic rose on the map at the location defined by the reference and anchor points. - {verbose} - {panel} - {coltypes} - {perspective} - {transparency} + $verbose + $panel + $coltypes + $perspective + $transparency """ self._activate_figure() diff --git a/pygmt/src/binstats.py b/pygmt/src/binstats.py index 34daddb4f57..e629303b17c 100644 --- a/pygmt/src/binstats.py +++ b/pygmt/src/binstats.py @@ -65,7 +65,7 @@ def binstats( Full GMT docs at :gmt-docs:`gmtbinstats.html`. - {aliases} + $aliases - C = statistic - I = spacing - R = region @@ -76,8 +76,8 @@ def binstats( Parameters ---------- data - A file name of an ASCII data table or a 2-D {table-classes}. - {outgrid} + A file name of an ASCII data table or a 2-D $table_classes. + $outgrid statistic Choose the statistic that will be computed per node based on the points that are within *radius* distance of the node. Select one of: @@ -116,14 +116,14 @@ def binstats( computed while the count will be the sum of the weights instead of number of points. If the weights are actually uncertainties (one sigma) then append **+s** and weight = 1/sigma. - {spacing} - {region} - {verbose} - {aspatial} - {binary} - {header} - {incols} - {registration} + $spacing + $region + $verbose + $aspatial + $binary + $header + $incols + $registration Returns ------- diff --git a/pygmt/src/blockm.py b/pygmt/src/blockm.py index 67947d6f5d6..e4c5cadbba7 100644 --- a/pygmt/src/blockm.py +++ b/pygmt/src/blockm.py @@ -111,7 +111,7 @@ def blockmean( # noqa: PLR0913 Full GMT docs at :gmt-docs:`blockmean.html`. - {aliases} + $aliases - I = spacing - R = region - V = verbose @@ -124,12 +124,12 @@ def blockmean( # noqa: PLR0913 data Pass in (x, y, z) or (longitude, latitude, elevation) values by providing a file name to an ASCII data table, a 2-D - {table-classes}. + $table_classes. x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. - {output_type} - {outfile} - {spacing} + $output_type + $outfile + $spacing summary : str [**m**\|\ **n**\|\ **s**\|\ **w**]. Type of summary values calculated by blockmean. @@ -138,18 +138,18 @@ def blockmean( # noqa: PLR0913 - **n**: report the number of input points inside each block - **s**: report the sum of all z-values inside a block - **w**: report the sum of weights - {region} - {verbose} - {aspatial} - {binary} - {nodata} - {find} - {incols} - {coltypes} - {header} - {outcols} - {registration} - {wrap} + $region + $verbose + $aspatial + $binary + $nodata + $find + $incols + $coltypes + $header + $outcols + $registration + $wrap Returns ------- @@ -226,7 +226,7 @@ def blockmedian( # noqa: PLR0913 Full GMT docs at :gmt-docs:`blockmedian.html`. - {aliases} + $aliases - I = spacing - R = region - V = verbose @@ -239,24 +239,24 @@ def blockmedian( # noqa: PLR0913 data Pass in (x, y, z) or (longitude, latitude, elevation) values by providing a file name to an ASCII data table, a 2-D - {table-classes}. + $table_classes. x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. - {output_type} - {outfile} - {spacing} - {region} - {verbose} - {aspatial} - {binary} - {nodata} - {find} - {coltypes} - {header} - {incols} - {outcols} - {registration} - {wrap} + $output_type + $outfile + $spacing + $region + $verbose + $aspatial + $binary + $nodata + $find + $coltypes + $header + $incols + $outcols + $registration + $wrap Returns ------- @@ -341,7 +341,7 @@ def blockmode( # noqa: PLR0913 Full GMT docs at :gmt-docs:`blockmode.html`. - {aliases} + $aliases - I = spacing - R = region - V = verbose @@ -354,24 +354,24 @@ def blockmode( # noqa: PLR0913 data Pass in (x, y, z) or (longitude, latitude, elevation) values by providing a file name to an ASCII data table, a 2-D - {table-classes}. + $table_classes. x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. - {output_type} - {outfile} - {spacing} - {region} - {verbose} - {aspatial} - {binary} - {nodata} - {find} - {coltypes} - {header} - {incols} - {outcols} - {registration} - {wrap} + $output_type + $outfile + $spacing + $region + $verbose + $aspatial + $binary + $nodata + $find + $coltypes + $header + $incols + $outcols + $registration + $wrap Returns ------- diff --git a/pygmt/src/coast.py b/pygmt/src/coast.py index 9f54ffcafe0..ae6efb3e0bb 100644 --- a/pygmt/src/coast.py +++ b/pygmt/src/coast.py @@ -66,7 +66,7 @@ def coast( Full GMT docs at :gmt-docs:`coast.html`. - {aliases} + $aliases - B = frame - D = resolution - F = box @@ -79,11 +79,11 @@ def coast( Parameters ---------- - {projection} - {region} + $projection + $region *Required if this is the first plot command.* - {area_thresh} - {frame} + $area_thresh + $frame lakes : str or list *fill*\ [**+l**\|\ **+r**]. Set the shade, color, or pattern for lakes and river-lakes. The @@ -172,10 +172,10 @@ def coast( to any of the continent codes (e.g. ``"=EU"`` for Europe). Append **+p**\ *pen* to draw polygon outlines [Default is no outline] and **+g**\ *fill* to fill them [Default is no fill]. - {panel} - {perspective} - {transparency} - {verbose} + $panel + $perspective + $transparency + $verbose Example ------- diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index 19ab7d413b6..162c30f5d08 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -44,7 +44,7 @@ def colorbar( # noqa: PLR0913 .. note:: For GMT >=6.5.0, the fontsizes of the colorbar x-label, x-annotations, and y-label are scaled based on the width of the colorbar following - :math:`\sqrt{{colorbar\_width / 15}}`. To set a desired fontsize via the + :math:`\sqrt{colorbar\_width / 15}`. To set a desired fontsize via the GMT default parameters :gmt-term:`FONT_ANNOT_PRIMARY`, :gmt-term:`FONT_ANNOT_SECONDARY`, and :gmt-term:`FONT_LABEL` (or jointly :gmt-term:`FONT`) users have to divide the desired fontsize by the value @@ -54,7 +54,7 @@ def colorbar( # noqa: PLR0913 Full GMT docs at :gmt-docs:`colorbar.html`. - {aliases} + $aliases - B = frame - F = box - G = truncate @@ -70,7 +70,7 @@ def colorbar( # noqa: PLR0913 ---------- frame : str or list Set colorbar boundary frame, labels, and axes attributes. - {cmap} + $cmap position : str [**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\ [**+w**\ *length*\ [/\ *width*]]\ [**+e**\ [**b**\|\ **f**][*length*]]\ @@ -134,10 +134,10 @@ def colorbar( # noqa: PLR0913 may be in plot distance units or given as relative fractions and will be automatically scaled so that the sum of the widths equals the requested colorbar length. - {verbose} - {panel} - {perspective} - {transparency} + $verbose + $panel + $perspective + $transparency Example ------- diff --git a/pygmt/src/contour.py b/pygmt/src/contour.py index fc2a81ec14c..aa19b3c3584 100644 --- a/pygmt/src/contour.py +++ b/pygmt/src/contour.py @@ -59,7 +59,7 @@ def contour( # noqa: PLR0913 Full GMT docs at :gmt-docs:`contour.html`. - {aliases} + $aliases - B = frame - J = projection - N = no_clip @@ -75,11 +75,11 @@ def contour( # noqa: PLR0913 data Pass in (x, y, z) or (longitude, latitude, elevation) values by providing a file name to an ASCII data table, a 2-D - {table-classes}. + $table_classes. x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. - {projection} - {region} + $projection + $region annotation : float, list, or str Specify or disable annotated contour levels, modifies annotated contours specified in ``levels``. @@ -90,7 +90,7 @@ def contour( # noqa: PLR0913 - Adjust the appearance by appending different modifiers, e.g., ``"annot_int+f10p+gred"`` gives annotations with a font size of 10 points and a red filled box. For all available modifiers see :gmt-docs:`contour.html#a`. - {frame} + $frame levels : float, list, or str Specify the contour lines to generate. @@ -139,16 +139,16 @@ def contour( # noqa: PLR0913 to be of the format [*annotcontlabel*][/*contlabel*]. If either label contains a slash (/) character then use ``|`` as the separator for the two labels instead. - {verbose} - {binary} - {panel} - {nodata} - {find} - {coltypes} - {header} - {incols} - {perspective} - {transparency} + $verbose + $binary + $panel + $nodata + $find + $coltypes + $header + $incols + $perspective + $transparency """ self._activate_figure() diff --git a/pygmt/src/dimfilter.py b/pygmt/src/dimfilter.py index 86fb15fc671..250184e963e 100644 --- a/pygmt/src/dimfilter.py +++ b/pygmt/src/dimfilter.py @@ -47,15 +47,15 @@ def dimfilter( Full GMT docs at :gmt-docs:`dimfilter.html`. - {aliases} + $aliases - I = spacing - R = region - V = verbose Parameters ---------- - {grid} - {outgrid} + $grid + $outgrid distance : int or str Distance flag tells how grid (x,y) relates to filter width, as follows: @@ -112,7 +112,7 @@ def dimfilter( region : str or list [*xmin*, *xmax*, *ymin*, *ymax*]. Define the region of the output points [Default is the same as the input]. - {verbose} + $verbose Returns ------- diff --git a/pygmt/src/filter1d.py b/pygmt/src/filter1d.py index 101cd9c9f1d..edad413c990 100644 --- a/pygmt/src/filter1d.py +++ b/pygmt/src/filter1d.py @@ -41,13 +41,13 @@ def filter1d( Full GMT docs at :gmt-docs:`filter1d.html`. - {aliases} + $aliases - V = verbose Parameters ---------- - {output_type} - {outfile} + $output_type + $outfile filter_type : str **type**\ *width*\ [**+h**]. Set the filter **type**. Choose among convolution and non-convolution diff --git a/pygmt/src/grd2cpt.py b/pygmt/src/grd2cpt.py index 3408faa2c65..964a25de64e 100644 --- a/pygmt/src/grd2cpt.py +++ b/pygmt/src/grd2cpt.py @@ -85,7 +85,7 @@ def grd2cpt( Full GMT docs at :gmt-docs:`grd2cpt.html`. - {aliases} + $aliases - G = truncate - M = overrule_bg - N = no_bg @@ -96,7 +96,7 @@ def grd2cpt( Parameters ---------- - {grid} + $grid transparency : float or str Set a constant level of transparency (0-100) for all color slices. Append **+a** to also affect the foreground, background, and NaN colors [Default is no @@ -182,7 +182,7 @@ def grd2cpt( Produce a wrapped (cyclic) color table that endlessly repeats its range. Note that ``cyclic=True`` cannot be set together with ``categorical=True``. - {verbose} + $verbose Example ------- diff --git a/pygmt/src/grd2xyz.py b/pygmt/src/grd2xyz.py index eee6fe751d4..fe8b98d8060 100644 --- a/pygmt/src/grd2xyz.py +++ b/pygmt/src/grd2xyz.py @@ -51,16 +51,16 @@ def grd2xyz( Full GMT docs at :gmt-docs:`grd2xyz.html`. - {aliases} + $aliases - R = region - V = verbose - o = outcols Parameters ---------- - {grid} - {output_type} - {outfile} + $grid + $output_type + $outfile cstyle : str [**f**\|\ **i**]. Replace the x- and y-coordinates on output with the corresponding @@ -68,7 +68,7 @@ def grd2xyz( **f** to start at 1 (Fortran-style counting). Alternatively, append **i** to write just the two columns *index* and *z*, where *index* is the 1-D indexing that GMT uses when referring to grid nodes. - {region} + $region Adding ``region`` will select a subsection of the grid. If this subsection exceeds the boundaries of the grid, only the common region will be output. @@ -83,7 +83,7 @@ def grd2xyz( this by appending **+u**\ *unit*. For such grids, the area varies with latitude and also sees special cases for gridline-registered layouts at sides, corners, and poles. - {verbose} + $verbose convention : str [*flags*]. Write a 1-column ASCII [or binary] table. Output will be organized @@ -114,12 +114,12 @@ def grd2xyz( - **d**: 8-byte floating point double precision Default format is scanline orientation of ASCII numbers: **TLa**. - {binary} - {nodata} - {coltypes} - {header} - {outcols} - {skiprows} + $binary + $nodata + $coltypes + $header + $outcols + $skiprows Returns ------- diff --git a/pygmt/src/grdclip.py b/pygmt/src/grdclip.py index 9265ccbdd88..348c90c8740 100644 --- a/pygmt/src/grdclip.py +++ b/pygmt/src/grdclip.py @@ -61,9 +61,9 @@ def grdclip( Parameters ---------- - {grid} - {outgrid} - {region} + $grid + $outgrid + $region above Pass a sequence of two values in the form of (*high*, *above*), to set all node values greater than *high* to *above*. @@ -81,7 +81,7 @@ def grdclip( (e.g., list of lists or 2-D numpy array) to replace different old values with different new values. This is mostly useful when your data are known to be integer values. - {verbose} + $verbose Returns ------- diff --git a/pygmt/src/grdcontour.py b/pygmt/src/grdcontour.py index 925147e47c0..fada25fddc4 100644 --- a/pygmt/src/grdcontour.py +++ b/pygmt/src/grdcontour.py @@ -55,7 +55,7 @@ def grdcontour( Full GMT docs at :gmt-docs:`grdcontour.html`. - {aliases} + $aliases - B = frame - J = projection - R = region @@ -66,7 +66,7 @@ def grdcontour( Parameters ---------- - {grid} + $grid levels : float, list, or str Specify the contour lines to generate. @@ -94,16 +94,16 @@ def grdcontour( Do not draw contours with less than `cut` number of points. resample : str or int Resample smoothing factor. - {projection} - {region} - {frame} + $projection + $region + $frame label_placement : str [**d**\|\ **f**\|\ **n**\|\ **l**\|\ **L**\|\ **x**\|\ **X**]\ *args*. Control the placement of labels along the quoted lines. It supports five controlling algorithms. See :gmt-docs:`grdcontour.html#g` for details. - {verbose} + $verbose pen : str or list [*type*]\ *pen*\ [**+c**\ [**l**\|\ **f**]]. *type*, if present, can be **a** for annotated contours or **c** for regular @@ -114,8 +114,8 @@ def grdcontour( contour lines are taken from the CPT (see ``levels``). If **+cf** is appended the colors from the CPT file are applied to the contour annotations. Select **+c** for both effects. - {panel} - {coltypes} + $panel + $coltypes label : str Add a legend entry for the contour being plotted. Normally, the annotated contour is selected for the legend. You can select the @@ -123,8 +123,8 @@ def grdcontour( to be of the format [*annotcontlabel*][/*contlabel*]. If either label contains a slash (/) character then use ``|`` as the separator for the two labels instead. - {perspective} - {transparency} + $perspective + $transparency Example ------- diff --git a/pygmt/src/grdcut.py b/pygmt/src/grdcut.py index cf198d9dc74..3b7bdfd9455 100644 --- a/pygmt/src/grdcut.py +++ b/pygmt/src/grdcut.py @@ -46,22 +46,22 @@ def grdcut( Full GMT docs at :gmt-docs:`grdcut.html`. - {aliases} + $aliases - J = projection - R = region - V = verbose Parameters ---------- - {grid} + $grid kind The raster data kind. Valid values are ``"grid"`` and ``"image"``. When the input ``grid`` is a file name, it's difficult to determine if the file is a grid or an image, so we need to specify the raster kind explicitly. The default is ``"grid"``. - {outgrid} - {projection} - {region} + $outgrid + $projection + $region extend : bool or float Allow grid to be extended if new ``region`` exceeds existing boundaries. Give a value to initialize nodes outside current region. @@ -87,8 +87,8 @@ def grdcut( considering the range of the core subset for further reduction of the area. - {verbose} - {coltypes} + $verbose + $coltypes Returns ------- diff --git a/pygmt/src/grdfill.py b/pygmt/src/grdfill.py index 11dd368caf5..ac08f368f59 100644 --- a/pygmt/src/grdfill.py +++ b/pygmt/src/grdfill.py @@ -99,7 +99,7 @@ def grdfill( # noqa: PLR0913 Full GMT docs at :gmt-docs:`grdfill.html`. - {aliases} + $aliases - Ac = constantfill - Ag = gridfill - An = neighborfill @@ -111,8 +111,8 @@ def grdfill( # noqa: PLR0913 Parameters ---------- - {grid} - {outgrid} + $grid + $outgrid constantfill Fill the holes with a constant value. Specify the constant value to use. gridfill @@ -121,7 +121,7 @@ def grdfill( # noqa: PLR0913 neighborfill Fill the holes with the nearest neighbor. Specify the search radius in pixels. If set to ``True``, the default search radius will be used - (:math:`r^2 = \sqrt{{n^2 + m^2}}`, where (*n,m*) are the node dimensions of the + (:math:`r^2 = \sqrt{n^2 + m^2}`, where (*n,m*) are the node dimensions of the grid). splinefill Fill the holes with a bicubic spline. Specify the tension value to use. If set @@ -136,16 +136,16 @@ def grdfill( # noqa: PLR0913 mode Specify the hole-filling algorithm to use. Choose from **c** for constant fill and append the constant value, **n** for nearest neighbor (and optionally append - a search radius in pixels [default radius is :math:`r^2 = \sqrt{{ X^2 + Y^2 }}`, + a search radius in pixels [default radius is :math:`r^2 = \sqrt{ X^2 + Y^2 }`, where (*X,Y*) are the node dimensions of the grid]), or **s** for bicubic spline (optionally append a *tension* parameter [Default is no tension]). .. deprecated:: 0.15.0 Use ``constantfill``, ``gridfill``, ``neighborfill``, or ``splinefill`` instead. The parameter will be removed in v0.19.0. - {region} - {coltypes} - {verbose} + $region + $coltypes + $verbose Returns ------- diff --git a/pygmt/src/grdfilter.py b/pygmt/src/grdfilter.py index f9408bf6170..a1e9393abb3 100644 --- a/pygmt/src/grdfilter.py +++ b/pygmt/src/grdfilter.py @@ -41,7 +41,7 @@ def grdfilter( Full GMT docs at :gmt-docs:`grdfilter.html`. - {aliases} + $aliases - I = spacing - R = region - T = toggle @@ -51,8 +51,8 @@ def grdfilter( Parameters ---------- - {grid} - {outgrid} + $grid + $outgrid filter : str **b**\|\ **c**\|\ **g**\|\ **o**\|\ **m**\|\ **p**\|\ **h**\ *width*\ [/*width2*\][*modifiers*]. @@ -88,7 +88,7 @@ def grdfilter( - ``"5"``: grid (x,y) in Mercator ``projection="m1"`` img units, *width* in km, Spherical distance calculation. - {spacing} + $spacing nans : str or float **i**\|\ **p**\|\ **r**. Determine how NaN-values in the input grid affect the filtered output. @@ -97,15 +97,15 @@ def grdfilter( the output node will be set to NaN (only applies if both grids are co-registered). **p** will force the filtered value to be NaN if any grid nodes with NaN-values are found inside the filter circle. - {region} + $region toggle Toggle the node registration for the output grid so as to become the opposite of the input grid [Default gives the same registration as the input grid]. Alternatively, use ``registration`` to set the registration explicitly. - {verbose} - {coltypes} - {registration} - {cores} + $verbose + $coltypes + $registration + $cores Returns ------- diff --git a/pygmt/src/grdgradient.py b/pygmt/src/grdgradient.py index cf425a00f3e..2ee0c62c7b5 100644 --- a/pygmt/src/grdgradient.py +++ b/pygmt/src/grdgradient.py @@ -42,7 +42,7 @@ def grdgradient( Full GMT docs at :gmt-docs:`grdgradient.html`. - {aliases} + $aliases - A = azimuth - E = radiance - R = region @@ -50,16 +50,16 @@ def grdgradient( Parameters ---------- - {grid} - {outgrid} + $grid + $outgrid azimuth *azim* or (*azim*, *azim2*). Azimuthal direction for a directional derivative; *azim* is the angle in the x,y plane measured in degrees positive clockwise from north (the positive y-direction) toward east (the positive x-direction). The negative of the directional derivative, - :math:`-(\frac{{dz}}{{dx}}\sin(\mbox{{azim}}) + \ - \frac{{dz}}{{dy}}\cos(\mbox{{azim}}))`, is found; negation yields + :math:`-(\frac{dz}{dx}\sin(\mbox{azim}) + \ + \frac{dz}{dy}\cos(\mbox{azim}))`, is found; negation yields positive values when the slope of :math:`z(x,y)` is downhill in the *azim* direction, the correct sense for shading the illumination of an image by a light source above the x,y plane shining from the *azim* @@ -109,18 +109,18 @@ def grdgradient( given, it is set to the average of :math:`g`. The following forms are supported: - - **True**: Normalize using :math:`g_n = \mbox{{amp}}\ - (\frac{{g - \mbox{{offset}}}}{{max(|g - \mbox{{offset}}|)}})` + - **True**: Normalize using math:`g_n = \mbox{amp}\ + (\frac{g - \mbox{offset}}{max(|g - \mbox{offset}|)})` - **e**: Normalize using a cumulative Laplace distribution yielding: - :math:`g_n = \mbox{{amp}}(1 - \ - \exp{{(\sqrt{{2}}\frac{{g - \mbox{{offset}}}}{{\sigma}}))}}`, where + :math:`g_n = \mbox{amp}(1 - \ + \exp{(\sqrt{2}\frac{g - \mbox{offset}}{\sigma}))}`, where :math:`\sigma` is estimated using the L1 norm of - :math:`(g - \mbox{{offset}})` if it is not given. + :math:`(g - \mbox{offset})` if it is not given. - **t**: Normalize using a cumulative Cauchy distribution yielding: :math:`g_n = \ - \frac{{2(\mbox{{amp}})}}{{\pi}}(\tan^{{-1}}(\frac{{g - \ - \mbox{{offset}}}}{{\sigma}}))` where :math:`\sigma` is estimated - using the L2 norm of :math:`(g - \mbox{{offset}})` if it is not + \frac{2(\mbox{amp})}{\pi}(\tan^{-1}(\frac{g - \ + \mbox{offset}}{\sigma}))` where :math:`\sigma` is estimated + using the L2 norm of :math:`(g - \mbox{offset})` if it is not given. As a final option, you may add **+a**\ *ambient* to add *ambient* to @@ -136,13 +136,13 @@ def grdgradient( grid output is not needed for this run then do not specify ``outgrid``. For subsequent runs, just use **r** to read these values. Using **R** will read then delete the statistics file. - {region} + $region slope_file : str Name of output grid file with scalar magnitudes of gradient vectors. Requires ``direction`` but makes ``outgrid`` optional. - {verbose} - {coltypes} - {interpolation} + $verbose + $coltypes + $interpolation Returns ------- diff --git a/pygmt/src/grdhisteq.py b/pygmt/src/grdhisteq.py index a877ab69198..a92adade6bf 100644 --- a/pygmt/src/grdhisteq.py +++ b/pygmt/src/grdhisteq.py @@ -77,14 +77,14 @@ def equalize_grid( Full GMT docs at :gmt-docs:`grdhisteq.html`. - {aliases} + $aliases - R = region - V = verbose Parameters ---------- - {grid} - {outgrid} + $grid + $outgrid divisions : int Set the number of divisions of the data range. gaussian : bool or int or float @@ -94,8 +94,8 @@ def equalize_grid( range. quadratic: bool Perform quadratic equalization [Default is linear]. - {region} - {verbose} + $region + $verbose Returns ------- @@ -175,22 +175,22 @@ def compute_bins( Full GMT docs at :gmt-docs:`grdhisteq.html`. - {aliases} + $aliases - R = region - V = verbose Parameters ---------- - {grid} - {output_type} - {outfile} + $grid + $output_type + $outfile divisions : int Set the number of divisions of the data range. quadratic : bool Perform quadratic equalization [Default is linear]. - {region} - {verbose} - {header} + $region + $verbose + $header Returns ------- diff --git a/pygmt/src/grdimage.py b/pygmt/src/grdimage.py index fdd5dced557..563872fe775 100644 --- a/pygmt/src/grdimage.py +++ b/pygmt/src/grdimage.py @@ -74,7 +74,7 @@ def grdimage( # noqa: PLR0913 Full GMT docs at :gmt-docs:`grdimage.html`. - {aliases} + $aliases - B = frame - J = projection - M = monochrome @@ -88,9 +88,9 @@ def grdimage( # noqa: PLR0913 Parameters ---------- - {grid} - {frame} - {cmap} + $grid + $frame + $cmap img_in : str [**r**]. GMT will automatically detect standard image files (Geotiff, TIFF, @@ -132,7 +132,7 @@ def grdimage( # noqa: PLR0913 suitable modifiers [Default is no illumination]. **Note**: If the input data represent an *image* then an *intensfile* or constant *intensity* must be provided. - {projection} + $projection monochrome Force conversion to monochrome image using the (television) YIQ transformation. Cannot be used with ``nan_transparent``. @@ -146,14 +146,14 @@ def grdimage( # noqa: PLR0913 3). If the input is a grid, use **+z** to select another grid value than NaN. If input is instead an image, append an alternate *color* to select another pixel value to be transparent [Default is ``"black"``]. - {region} - {verbose} - {panel} - {coltypes} - {interpolation} - {perspective} - {transparency} - {cores} + $region + $verbose + $panel + $coltypes + $interpolation + $perspective + $transparency + $cores Example ------- diff --git a/pygmt/src/grdinfo.py b/pygmt/src/grdinfo.py index 671c9cd9628..5f8a5db00fd 100644 --- a/pygmt/src/grdinfo.py +++ b/pygmt/src/grdinfo.py @@ -42,7 +42,7 @@ def grdinfo( Full GMT docs at :gmt-docs:`grdinfo.html`. - {aliases} + $aliases - D = tiles - I = spacing - R = region @@ -50,8 +50,8 @@ def grdinfo( Parameters ---------- - {grid} - {region} + $grid + $region per_column : str or bool **n**\|\ **t**. Format the report using tab-separated fields on a single line. The @@ -114,8 +114,8 @@ def grdinfo( absolute value of the two extremes, append **+s**. We report the result via the text string *zmin/zmax* or *zmin/zmax/dz* (if *dz* was given) as expected by :func:`pygmt.makecpt`. - {verbose} - {coltypes} + $verbose + $coltypes Returns ------- diff --git a/pygmt/src/grdlandmask.py b/pygmt/src/grdlandmask.py index 5526ff35647..cb885242697 100644 --- a/pygmt/src/grdlandmask.py +++ b/pygmt/src/grdlandmask.py @@ -43,7 +43,7 @@ def grdlandmask( Full GMT docs at :gmt-docs:`grdlandmask.html`. - {aliases} + $aliases - D = resolution - E = bordervalues - I = spacing @@ -55,10 +55,10 @@ def grdlandmask( Parameters ---------- - {outgrid} - {spacing} - {region} - {area_thresh} + $outgrid + $spacing + $region + $area_thresh resolution Select the resolution of the coastline dataset to use. The available resolutions from highest to lowest are: ``"full"``, ``"high"``, ``"intermediate"``, @@ -91,9 +91,9 @@ def grdlandmask( Values can be any number, or one of ``None``, ``"NaN"``, and ``np.nan`` for setting nodes to NaN. - {verbose} - {registration} - {cores} + $verbose + $registration + $cores Returns ------- diff --git a/pygmt/src/grdproject.py b/pygmt/src/grdproject.py index 30eb3e1c4df..eb2b66e1f9a 100644 --- a/pygmt/src/grdproject.py +++ b/pygmt/src/grdproject.py @@ -49,7 +49,7 @@ def grdproject( Full GMT docs at :gmt-docs:`grdproject.html`. - {aliases} + $aliases - C = center - D = spacing - J = projection @@ -59,20 +59,20 @@ def grdproject( Parameters ---------- - {grid} - {outgrid} + $grid + $outgrid inverse : bool When set to ``True`` transforms grid from rectangular to geographical [Default is ``False``]. - {projection} - {region} + $projection + $region center If ``True``, let the projected coordinates be relative to the projection center [Default is relative to the lower left corner]. Optionally, set offsets (*dx*, *dy*) in the projected units to be added (or subtracted when ``inverse`` is set) to (from) the projected coordinates, such as false eastings and northings for particular projection zones [Default is ``(0, 0)``]. - {spacing} + $spacing dpi : int Set the resolution for the new grid in dots per inch. scaling : str @@ -87,9 +87,9 @@ def grdproject( Append **c**, **i**, or **p** to indicate that centimeters, inches, or points should be the projected measure unit. Cannot be used with ``scaling``. - {verbose} - {interpolation} - {registration} + $verbose + $interpolation + $registration Returns ------- diff --git a/pygmt/src/grdsample.py b/pygmt/src/grdsample.py index ad15d09d4c9..b50d68369e2 100644 --- a/pygmt/src/grdsample.py +++ b/pygmt/src/grdsample.py @@ -54,7 +54,7 @@ def grdsample( Full GMT docs at :gmt-docs:`grdsample.html`. - {aliases} + $aliases - I = spacing - R = region - V = verbose @@ -63,20 +63,20 @@ def grdsample( Parameters ---------- - {grid} - {outgrid} - {spacing} - {region} + $grid + $outgrid + $spacing + $region toggle Toggle between grid and pixel registration; if the input is grid-registered, the output will be pixel-registered and vice-versa. This is a *destructive* grid change; see :gmt-docs:`reference/options.html#switch-registrations`. *Note**: ``toggle`` and ``registration`` are mutually exclusive. - {verbose} - {coltypes} - {interpolation} - {registration} - {cores} + $verbose + $coltypes + $interpolation + $registration + $cores Returns ------- diff --git a/pygmt/src/grdtrack.py b/pygmt/src/grdtrack.py index 4afac0589aa..236cff1da8e 100644 --- a/pygmt/src/grdtrack.py +++ b/pygmt/src/grdtrack.py @@ -79,7 +79,7 @@ def grdtrack( Full GMT docs at :gmt-docs:`grdtrack.html`. - {aliases} + $aliases - R = region - V = verbose - i = incols @@ -87,13 +87,13 @@ def grdtrack( Parameters ---------- - {grid} + $grid points Pass in either a file name to an ASCII data table, a 2-D - {table-classes}. - {output_type} - {outfile} + $table_classes. + $output_type + $outfile newcolname : str Required if ``points`` is a :class:`pandas.DataFrame`. The name for the new column in the track :class:`pandas.DataFrame` table where the @@ -197,7 +197,7 @@ def grdtrack( nearest distance nodes along the cross-profiles. We write 13 output columns per track: *dist, lonc, latc, distc, azimuthc, zc, lonl, latl, distl, lonr, latr, distr, width*. - {region} + $region no_skip : bool Do *not* skip points that fall outside the domain of the grid(s) [Default only output points within the grid domain]. @@ -255,22 +255,22 @@ def grdtrack( spherical degrees. Use *radius* to change the unit and give *radius* = 0 if you do not want to limit the radius search. To instead replace the input point with the coordinates of the nearest node, append **+p**. - {verbose} + $verbose z_only : bool Only write out the sampled z-values [Default writes all columns]. - {aspatial} - {binary} - {nodata} - {find} - {coltypes} - {gap} - {header} - {incols} - {distcalc} - {interpolation} - {outcols} - {skiprows} - {wrap} + $aspatial + $binary + $nodata + $find + $coltypes + $gap + $header + $incols + $distcalc + $interpolation + $outcols + $skiprows + $wrap Returns ------- diff --git a/pygmt/src/grdview.py b/pygmt/src/grdview.py index 0a62dd4f79e..06b5ef1ab55 100644 --- a/pygmt/src/grdview.py +++ b/pygmt/src/grdview.py @@ -53,7 +53,7 @@ def grdview( # noqa: PLR0913 Full GMT docs at :gmt-docs:`grdview.html`. - {aliases} + $aliases - B = frame - J = projection - Jz = zscale @@ -66,16 +66,16 @@ def grdview( # noqa: PLR0913 Parameters ---------- - {grid} + $grid region : str or list *xmin/xmax/ymin/ymax*\ [**+r**][**+u**\ *unit*]. Specify the :doc:`region ` of interest. When used with ``perspective``, optionally append */zmin/zmax* to indicate the range to use for the 3-D axes [Default is the region given by the input grid]. - {projection} + $projection zscale/zsize Set z-axis scaling or z-axis size. - {frame} + $frame cmap : str The name of the color palette table to use. drapegrid : str or :class:`xarray.DataArray` @@ -118,12 +118,12 @@ def grdview( # noqa: PLR0913 **+m**\ *ambient* to specify azimuth, intensity, and ambient arguments for that function, or just give **+d** to select the default arguments [Default is ``"+a-45+nt1+m0"``]. - {verbose} - {panel} - {coltypes} - {interpolation} - {perspective} - {transparency} + $verbose + $panel + $coltypes + $interpolation + $perspective + $transparency Example ------- diff --git a/pygmt/src/grdvolume.py b/pygmt/src/grdvolume.py index 1f97f12994d..c8470297b57 100644 --- a/pygmt/src/grdvolume.py +++ b/pygmt/src/grdvolume.py @@ -45,15 +45,15 @@ def grdvolume( Full GMT docs at :gmt-docs:`grdvolume.html`. - {aliases} + $aliases - R = region - V = verbose Parameters ---------- - {grid} - {output_type} - {outfile} + $grid + $output_type + $outfile contour : str, float, or list *cval*\|\ *low/high/delta*\|\ **r**\ *low/high*\|\ **r**\ *cval*. Find area, volume and mean height (volume/area) inside and above the @@ -68,8 +68,8 @@ def grdvolume( between two contours. If no *contour* is given then there is no contour and the entire grid area, volume and the mean height is returned and *cval* will be reported as 0. - {region} - {verbose} + $region + $verbose Returns ------- diff --git a/pygmt/src/histogram.py b/pygmt/src/histogram.py index 31eb489e184..f3f1f69212f 100644 --- a/pygmt/src/histogram.py +++ b/pygmt/src/histogram.py @@ -53,7 +53,7 @@ def histogram( Full GMT docs at :gmt-docs:`histogram.html`. - {aliases} + $aliases - B = frame - J = projection - R = region @@ -67,15 +67,15 @@ def histogram( ---------- data Pass in either a file name to an ASCII data table, a Python list, a 2-D - {table-classes}. - {projection} - {region} - {frame} - {cmap} + $table_classes. + $projection + $region + $frame + $cmap fill : str Set color or pattern for filling bars [Default is no fill]. - {pen} - {panel} + $pen + $panel annotate : bool or str [**+b**][**+f**\ *font*][**+o**\ *off*][**+r**]. Annotate each bar with the count it represents. Append any of the @@ -139,16 +139,16 @@ def histogram( To use weights provided as a second data column instead of pure counts, append **+w**. - {verbose} - {binary} - {nodata} - {find} - {header} - {incols} - {label} - {perspective} - {transparency} - {wrap} + $verbose + $binary + $nodata + $find + $header + $incols + $label + $perspective + $transparency + $wrap """ self._activate_figure() diff --git a/pygmt/src/image.py b/pygmt/src/image.py index 24a184812eb..d389e7477d9 100644 --- a/pygmt/src/image.py +++ b/pygmt/src/image.py @@ -46,7 +46,7 @@ def image( Full GMT docs at :gmt-docs:`image.html`. - {aliases} + $aliases - F = box - J = projection - M = monochrome @@ -62,8 +62,8 @@ def image( An Encapsulated PostScript (EPS) file or a raster image file. An EPS file must contain an appropriate BoundingBox. A raster file can have a depth of 1, 8, 24, or 32 bits and is read via GDAL. - {projection} - {region} + $projection + $region position : str [**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\ **+r**\ *dpi*\ **+w**\ [**-**]\ *width*\ [/*height*]\ [**+j**\ *justify*]\ @@ -85,10 +85,10 @@ def image( monochrome Convert color image to monochrome grayshades using the (television) YIQ-transformation. - {verbose} - {panel} - {perspective} - {transparency} + $verbose + $panel + $perspective + $transparency """ self._activate_figure() diff --git a/pygmt/src/info.py b/pygmt/src/info.py index 7673a039c68..d12f409fcfa 100644 --- a/pygmt/src/info.py +++ b/pygmt/src/info.py @@ -46,7 +46,7 @@ def info( Full GMT docs at :gmt-docs:`gmtinfo.html`. - {aliases} + $aliases - I = spacing - V = verbose - i = incols @@ -56,7 +56,7 @@ def info( ---------- data Pass in either a file name to an ASCII data table, a 1-D/2-D - {table-classes}. + $table_classes. per_column : bool Report the min/max values per column in separate columns. spacing @@ -71,11 +71,11 @@ def info( Report the min/max of the first (0'th) column to the nearest multiple of dz and output this in the form ``[zmin, zmax, dz]``. - {verbose} - {aspatial} - {incols} - {coltypes} - {registration} + $verbose + $aspatial + $incols + $coltypes + $registration Returns ------- diff --git a/pygmt/src/inset.py b/pygmt/src/inset.py index 30b5d316e0b..18f33efe4d0 100644 --- a/pygmt/src/inset.py +++ b/pygmt/src/inset.py @@ -37,7 +37,7 @@ def inset( Full GMT docs at :gmt-docs:`inset.html`. - {aliases} + $aliases - F = box - J = projection - N = no_clip @@ -102,9 +102,9 @@ def inset( no_clip Do **not** clip features extruding outside the inset frame boundaries [Default is ``False``]. - {region} - {projection} - {verbose} + $region + $projection + $verbose Examples -------- diff --git a/pygmt/src/legend.py b/pygmt/src/legend.py index 82dabc72478..6f5be423489 100644 --- a/pygmt/src/legend.py +++ b/pygmt/src/legend.py @@ -47,7 +47,7 @@ def legend( Full GMT docs at :gmt-docs:`legend.html`. - {aliases} + $aliases - F = box - J = projection - R = region @@ -67,8 +67,8 @@ def legend( - A :class:`io.StringIO` object containing the legend specification See :gmt-docs:`legend.html` for the definition of the legend specification. - {projection} - {region} + $projection + $region position : str [**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\ **+w**\ *width*\ [/*height*]\ [**+j**\ *justify*]\ [**+l**\ *spacing*]\ @@ -82,10 +82,10 @@ def legend( rectangular box is drawn using :gmt-term:`MAP_FRAME_PEN`. To customize the box appearance, pass a :class:`pygmt.params.Box` object to control style, fill, pen, and other box properties. - {verbose} - {panel} - {perspective} - {transparency} + $verbose + $panel + $perspective + $transparency """ self._activate_figure() diff --git a/pygmt/src/logo.py b/pygmt/src/logo.py index defdc065eb3..0087a7dddec 100644 --- a/pygmt/src/logo.py +++ b/pygmt/src/logo.py @@ -36,7 +36,7 @@ def logo( Full GMT docs at :gmt-docs:`gmtlogo.html`. - {aliases} + $aliases - F = box - J = projection - R = region @@ -48,8 +48,8 @@ def logo( Parameters ---------- - {projection} - {region} + $projection + $region position : str [**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\ **+w**\ *width*\ [**+j**\ *justify*]\ [**+o**\ *dx*\ [/*dy*]]. @@ -65,10 +65,10 @@ def logo( - ``"standard"``: The text label "The Generic Mapping Tools". - ``"no_label"``: Skip the text label. - ``"url"``: The URL to the GMT website. - {verbose} - {panel} - {transparency} - {perspective} + $verbose + $panel + $transparency + $perspective """ self._activate_figure() diff --git a/pygmt/src/makecpt.py b/pygmt/src/makecpt.py index 96adc0d426d..b2c36405840 100644 --- a/pygmt/src/makecpt.py +++ b/pygmt/src/makecpt.py @@ -73,7 +73,7 @@ def makecpt( Full GMT docs at :gmt-docs:`makecpt.html`. - {aliases} + $aliases - G = truncate - M = overrule_bg - N = no_bg @@ -157,7 +157,7 @@ def makecpt( continuous Force a continuous CPT when building from a list of colors and a list of z-values [Default is False, i.e. discrete CPT]. - {verbose} + $verbose categorical : bool Do not interpolate the input color table but pick the output colors starting at the beginning of the color table, until colors for all diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index 54fb84cac16..b9f9c956aa4 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -172,7 +172,7 @@ def meca( # noqa: PLR0913 | *mantissa*, *exponent* - | angles in degrees; | seismic moment is - | :math:`mantissa * 10 ^ {{exponent}}` + | :math:`mantissa * 10 ^ {exponent}` | in dyn cm * - ``"mt"`` - seismic moment tensor @@ -180,7 +180,7 @@ def meca( # noqa: PLR0913 | *mrt*, *mrf*, *mtf*, | *exponent* - | moment components - | in :math:`10 ^ {{exponent}}` dyn cm + | in :math:`10 ^ {exponent}` dyn cm * - ``"partial"`` - partial focal mechanism - | *strike1*, *dip1*, *strike2*, @@ -194,12 +194,12 @@ def meca( # noqa: PLR0913 | *n_value*, *n_azimuth*, *n_plunge*, | *p_value*, *p_azimuth*, *p_plunge*, | *exponent* - - | values in :math:`10 ^ {{exponent}}` dyn cm; + - | values in :math:`10 ^ {exponent}` dyn cm; | azimuths and plunges in degrees Full GMT docs at :gmt-docs:`supplements/seis/meca.html`. - {aliases} + $aliases - B = frame - J = projection - N = no_clip @@ -341,13 +341,13 @@ def meca( # noqa: PLR0913 no_clip Do **not** skip symbols that fall outside the frame boundaries [Default is ``False``, i.e., plot symbols inside the frame boundaries only]. - {projection} - {region} - {frame} - {verbose} - {panel} - {perspective} - {transparency} + $projection + $region + $frame + $verbose + $panel + $perspective + $transparency """ self._activate_figure() # Determine the focal mechanism convention from the input data or parameters. diff --git a/pygmt/src/nearneighbor.py b/pygmt/src/nearneighbor.py index 895cb704557..bc1f96eac24 100644 --- a/pygmt/src/nearneighbor.py +++ b/pygmt/src/nearneighbor.py @@ -54,9 +54,9 @@ def nearneighbor( function and the averaging used is given by: .. math:: - w(r_i) = \frac{{w_i}}{{1 + d(r_i) ^ 2}}, - \quad d(r) = \frac {{3r}}{{R}}, - \quad \bar{{z}} = \frac{{\sum_i^n w(r_i) z_i}}{{\sum_i^n w(r_i)}} + w(r_i) = \frac{w_i}{1 + d(r_i) ^ 2}, + \quad d(r) = \frac {3r}{R}, + \quad \bar{z} = \frac{\sum_i^n w(r_i) z_i}{\sum_i^n w(r_i)} where :math:`n` is the number of data points that satisfy the selection criteria and :math:`r_i` is the distance from the node to the *i*'th data @@ -78,7 +78,7 @@ def nearneighbor( Full GMT docs at :gmt-docs:`nearneighbor.html`. - {aliases} + $aliases - I = spacing - R = region - V = verbose @@ -90,18 +90,18 @@ def nearneighbor( data Pass in (x, y, z) or (longitude, latitude, elevation) values by providing a file name to an ASCII data table, a 2-D - {table-classes}. + $table_classes. x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. - {spacing} + $spacing - {region} + $region search_radius : str Set the search radius that determines which data points are considered close to a node. - {outgrid} + $outgrid empty : str Optional. Set the value assigned to empty nodes. Defaults to NaN. @@ -119,17 +119,17 @@ def nearneighbor( Alternatively, use ``sectors="n"`` to call GDAL's nearest neighbor algorithm instead. - {verbose} - {aspatial} - {binary} - {nodata} - {find} - {coltypes} - {gap} - {header} - {incols} - {registration} - {wrap} + $verbose + $aspatial + $binary + $nodata + $find + $coltypes + $gap + $header + $incols + $registration + $wrap Returns ------- diff --git a/pygmt/src/plot.py b/pygmt/src/plot.py index ead038eb3bb..f7c92bebc6e 100644 --- a/pygmt/src/plot.py +++ b/pygmt/src/plot.py @@ -85,7 +85,7 @@ def plot( # noqa: PLR0912, PLR0913 Full GMT docs at :gmt-docs:`plot.html`. - {aliases} + $aliases - A = straight_line - B = frame - J = projection @@ -100,7 +100,7 @@ def plot( # noqa: PLR0912, PLR0913 ---------- data Pass in either a file name to an ASCII data table, a 2-D - {table-classes}. + $table_classes. Use parameter ``incols`` to choose which columns are x, y, fill, and size, respectively. x/y : float or 1-D arrays @@ -116,8 +116,8 @@ def plot( # noqa: PLR0912, PLR0913 should be a list of two 1-D 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} - {region} + $projection + $region straight_line By default, line segments are drawn as straight lines in the Cartesian and polar coordinate systems, and as great circle arcs (by resampling coarse input data @@ -141,8 +141,8 @@ def plot( # noqa: PLR0912, PLR0913 meaning of *x* and *y* is reversed, i.e., *x* means meridians and *y* means parallels. The bug is fixed by upstream `PR #8648 `__. - {frame} - {cmap} + $frame + $cmap offset : str *dx*/*dy*. Offset the plot symbol or line locations by the given amounts @@ -178,7 +178,7 @@ def plot( # noqa: PLR0912, PLR0913 Instead of the codes **a**\|\ **r**\|\ **s**\|\ **t** you may append the coordinates of a *refpoint* which will serve as a fixed external reference point for all groups. - {fill} + $fill *fill* can be a 1-D array, but it is only valid if using ``x``/``y`` and ``cmap=True`` is also required. intensity : float, bool, or 1-D array @@ -209,8 +209,8 @@ def plot( # noqa: PLR0912, PLR0913 style : str Plot symbols (including vectors, pie slices, fronts, decorated or quoted lines). - {pen} - {verbose} + $pen + $verbose zvalue : str *value*\|\ *file*. Instead of specifying a symbol or polygon fill and outline color @@ -220,21 +220,21 @@ def plot( # noqa: PLR0912, PLR0913 polygon in the input data. To apply it to the fill color, use ``fill="+z"``. To apply it to the pen color, append **+z** to ``pen``. - {aspatial} - {binary} - {panel} - {nodata} - {find} - {coltypes} - {gap} - {header} - {incols} - {label} - {perspective} - {transparency} + $aspatial + $binary + $panel + $nodata + $find + $coltypes + $gap + $header + $incols + $label + $perspective + $transparency ``transparency`` can also be a 1-D array to set varying transparency for symbols, but this option is only valid if using ``x``/``y``. - {wrap} + $wrap """ # TODO(GMT>6.5.0): Remove the note for the upstream bug of the "straight_line" # parameter. diff --git a/pygmt/src/plot3d.py b/pygmt/src/plot3d.py index ee4cf2707a9..d4ce2940488 100644 --- a/pygmt/src/plot3d.py +++ b/pygmt/src/plot3d.py @@ -87,7 +87,7 @@ def plot3d( # noqa: PLR0912, PLR0913 Full GMT docs at :gmt-docs:`plot3d.html`. - {aliases} + $aliases - A = straight_line - B = frame - J = projection @@ -103,7 +103,7 @@ def plot3d( # noqa: PLR0912, PLR0913 Parameters ---------- data - Either a data file name, a 2-D {table-classes}. + Either a data file name, a 2-D $table_classes. Optionally, use parameter ``incols`` to specify which columns are x, y, z, fill, and size, respectively. x/y/z : float or 1-D arrays @@ -119,10 +119,10 @@ def plot3d( # noqa: PLR0912, PLR0913 should be a list of two 1-D 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} + $projection zscale/zsize Set z-axis scaling or z-axis size. - {region} + $region straight_line By default, line segments are drawn as straight lines in the Cartesian and polar coordinate systems, and as great circle arcs (by resampling coarse input data @@ -148,13 +148,13 @@ def plot3d( # noqa: PLR0912, PLR0913 meaning of *x* and *y* is reversed, i.e., *x* means meridians and *y* means parallels. The bug is fixed by upstream `PR #8648 `__. - {frame} - {cmap} + $frame + $cmap offset : str *dx*/*dy*\ [/*dz*]. Offset the plot symbol or line locations by the given amounts *dx*/*dy*\ [/*dz*] [Default is no offset]. - {fill} + $fill *fill* can be a 1-D array, but it is only valid if using ``x``/``y`` and ``cmap=True`` is also required. intensity : float, bool, or 1-D array @@ -189,8 +189,8 @@ def plot3d( # noqa: PLR0912, PLR0913 the foreground are plotted after items in the background. style : str Plot symbols. Full documentation is at :gmt-docs:`plot3d.html#s`. - {verbose} - {pen} + $verbose + $pen zvalue : str *value*\|\ *file*. Instead of specifying a symbol or polygon fill and outline color @@ -200,21 +200,21 @@ def plot3d( # noqa: PLR0912, PLR0913 polygon in the input data. To apply it to the fill color, use ``fill="+z"``. To apply it to the pen color, append **+z** to ``pen``. - {aspatial} - {binary} - {panel} - {nodata} - {find} - {coltypes} - {gap} - {header} - {incols} - {label} - {perspective} - {transparency} + $aspatial + $binary + $panel + $nodata + $find + $coltypes + $gap + $header + $incols + $label + $perspective + $transparency ``transparency`` can also be a 1-D array to set varying transparency for symbols, but this option is only valid if using ``x``/``y``/``z``. - {wrap} + $wrap """ # TODO(GMT>6.5.0): Remove the note for the upstream bug of the "straight_line" # parameter. diff --git a/pygmt/src/project.py b/pygmt/src/project.py index 1778a331cd3..ad88345d1cb 100644 --- a/pygmt/src/project.py +++ b/pygmt/src/project.py @@ -86,9 +86,9 @@ def project( # noqa: PLR0913 Data can be selectively windowed by using the ``length`` and ``width`` parameters. If ``width`` is used, the projection width is set to use only - data with :math:`w_{{min}} < q < w_{{max}}`. If ``length`` is set, then + data with :math:`w_{min} < q < w_{max}`. If ``length`` is set, then the length is set to use only those data with - :math:`l_{{min}} < p < l_{{max}}`. If the ``endpoint`` parameter + :math:`l_{min} < p < l_{max}`. If the ``endpoint`` parameter has been used to define the projection, then ``length="w"`` may be used to window the length of the projection to exactly the span from O to B. @@ -98,10 +98,10 @@ def project( # noqa: PLR0913 x-axis. azimuth = 90 - theta. No assumptions are made regarding the units for - :math:`x, y, r, s, p, q, dist, l_{{min}}, l_{{max}}, w_{{min}}, w_{{max}}`. + :math:`x, y, r, s, p, q, dist, l_{min}, l_{max}, w_{min}, w_{max}`. If ``unit`` is selected, map units are assumed and :math:`x, y, r, s` must be in degrees and - :math:`p, q, dist, l_{{min}}, l_{{max}}, w_{{min}}, w_{{max}}` + :math:`p, q, dist, l_{min}, l_{max}, w_{min}, w_{max}` will be in km. Calculations of specific great-circle and geodesic distances or for @@ -110,7 +110,7 @@ def project( # noqa: PLR0913 Full GMT docs at :gmt-docs:`project.html`. - {aliases} + $aliases - C = center - E = endpoint - L = length @@ -123,9 +123,9 @@ def project( # noqa: PLR0913 data Pass in (x, y, z) or (longitude, latitude, elevation) values by providing a file name to an ASCII data table, a 2-D - {table-classes}. - {output_type} - {outfile} + $table_classes. + $output_type + $outfile center Set the origin of the projection, in the form of (*cx*, *cy*), in Definitions 1 @@ -159,7 +159,7 @@ def project( # noqa: PLR0913 through *cx*/*cy*, append **+c** to compute the required colatitude. Use ``center`` and ``endpoint`` to generate a circle that goes through the center and end point. Note, in this case the center and - end point cannot be farther apart than :math:`2|\mbox{{colat}}|`. + end point cannot be farther apart than :math:`2|\mbox{colat}|`. Finally, if you append **+h** then we will report the position of the pole as part of the segment header [Default is no header]. **Note**: No input is read and the value of ``data``, ``x``, ``y``, @@ -167,7 +167,7 @@ def project( # noqa: PLR0913 length (*lmin*, *lmax*) or ``"limit"``. Project only those data whose *p* coordinate is within - :math:`l_{{min}} < p < l_{{max}}`. If ``endpoint`` has been set, then you may + :math:`l_{min} < p < l_{max}`. If ``endpoint`` has been set, then you may alternatively set it to ``"limit"`` to stay within the distance from ``center`` to ``endpoint``. flat_earth : bool @@ -176,7 +176,7 @@ def project( # noqa: PLR0913 unit : bool Set units for :math:`x, y, r, s` to degrees and - :math:`p, q, dist, l_{{min}}, l_{{max}}, w_{{min}}, w_{{max}}` to km. + :math:`p, q, dist, l_{min}, l_{max}, w_{min}, w_{max}` to km. [Default is ``False``; all arguments use the same units] sort : bool @@ -188,7 +188,7 @@ def project( # noqa: PLR0913 width (*w_min*, *w_max*). Specify width controls for the projected points. Project only those points whose - q coordinate is within :math:`w_{{min}} < q < w_{{max}}`. + q coordinate is within :math:`w_{min} < q < w_{max}`. ellipse : str *major*/*minor*/*azimuth* [**+e**\|\ **n**]. @@ -207,8 +207,8 @@ def project( # noqa: PLR0913 For the Cartesian ellipse (which requires ``flat_earth``), the *direction* is counter-clockwise from the horizontal instead of an *azimuth*. - {verbose} - {coltypes} + $verbose + $coltypes Returns ------- diff --git a/pygmt/src/psconvert.py b/pygmt/src/psconvert.py index 73e6cc84faf..6d486d9f277 100644 --- a/pygmt/src/psconvert.py +++ b/pygmt/src/psconvert.py @@ -36,7 +36,7 @@ def psconvert( Full GMT docs at :gmt-docs:`psconvert.html`. - {aliases} + $aliases - C = gs_option - E = dpi - F = prefix @@ -112,7 +112,7 @@ def psconvert( both an EPS and a PDF file. Using **F** creates a multi-page PDF file from the list of input PS or PDF files. It requires the ``prefix`` parameter. - {verbose} + $verbose """ self._activate_figure() # Default cropping the figure to True diff --git a/pygmt/src/rose.py b/pygmt/src/rose.py index 8a1a0e5d8f4..14edc5183a0 100644 --- a/pygmt/src/rose.py +++ b/pygmt/src/rose.py @@ -64,7 +64,7 @@ def rose( # noqa: PLR0913 Full GMT docs at :gmt-docs:`rose.html`. - {aliases} + $aliases - B = frame - R = region - V = verbose @@ -77,7 +77,7 @@ def rose( # noqa: PLR0913 ---------- data Pass in either a file name to an ASCII data table, a 2-D - {table-classes}. + $table_classes. Use parameter ``incols`` to choose which columns are length and azimuth, respectively. If a file with only azimuths is given, use ``incols`` to indicate the single column with azimuths; then all @@ -198,16 +198,16 @@ def rose( # noqa: PLR0913 Statistics, *J. Stat. Software*, 31(10), 1-21, https://doi.org/10.18637/jss.v031.i10. - {verbose} - {binary} - {panel} - {nodata} - {find} - {header} - {incols} - {perspective} - {transparency} - {wrap} + $verbose + $binary + $panel + $nodata + $find + $header + $incols + $perspective + $transparency + $wrap """ self._activate_figure() diff --git a/pygmt/src/select.py b/pygmt/src/select.py index 5c932393508..db37f8da54d 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -77,7 +77,7 @@ def select( Full GMT docs at :gmt-docs:`gmtselect.html`. - {aliases} + $aliases - D = resolution - J = projection - R = region @@ -89,10 +89,10 @@ def select( ---------- data Pass in either a file name to an ASCII data table, a 2-D - {table-classes}. - {output_type} - {outfile} - {area_thresh} + $table_classes. + $output_type + $outfile + $area_thresh dist2pt : str *pointfile*\|\ *lon*/*lat*\ **+d**\ *dist*. Pass all records whose locations are within *dist* of any of the @@ -145,7 +145,7 @@ def select( (and ``area_thresh``, ``resolution``). - **z** select records NOT within the range specified by ``z_subregion``. - {projection} + $projection mask : str or list Pass all records whose location is inside specified geographical features. Specify if records should be skipped (s) or kept (k) using @@ -165,8 +165,8 @@ def select( coastlines differ in details, a node in a mask file using one resolution is not guaranteed to remain inside [or outside] when a different resolution is selected. If ``None``, the low resolution is used by default. - {region} - {verbose} + $region + $verbose z_subregion : str or list *min*\ [/*max*]\ [**+a**]\ [**+c**\ *col*]\ [**+i**]. Pass all records whose 3rd column (*z*; *col* = 2) lies within the @@ -186,16 +186,16 @@ def select( and **+i** reverses the tests to pass record with *z* value NOT in the given range. Finally, if **+c** is not used then it is automatically incremented for each new ``z_subregion`` argument, starting with 2. - {binary} - {nodata} - {find} - {coltypes} - {gap} - {header} - {incols} - {outcols} - {skiprows} - {wrap} + $binary + $nodata + $find + $coltypes + $gap + $header + $incols + $outcols + $skiprows + $wrap Returns ------- diff --git a/pygmt/src/solar.py b/pygmt/src/solar.py index edfd5688d44..7669153e66f 100644 --- a/pygmt/src/solar.py +++ b/pygmt/src/solar.py @@ -74,17 +74,17 @@ def solar( # noqa: PLR0913 integer number of hours (e.g., -8 or +5); fractional hours are truncated towards zero (e.g., -8.5 becomes -8 and +5.5 becomes +5). [Default is the current UTC date and time]. - {region} - {projection} - {frame} + $region + $projection + $frame fill Set color or pattern for filling terminators [Default is no fill]. pen Set pen attributes for lines [Default is ``"0.25p,black,solid"``]. - {verbose} - {panel} - {perspective} - {transparency} + $verbose + $panel + $perspective + $transparency Example ------- diff --git a/pygmt/src/sph2grd.py b/pygmt/src/sph2grd.py index fc949e311da..8a210657645 100644 --- a/pygmt/src/sph2grd.py +++ b/pygmt/src/sph2grd.py @@ -37,7 +37,7 @@ def sph2grd( Full GMT docs at :gmt-docs:`sph2grd.html`. - {aliases} + $aliases - I = spacing - R = region - V = verbose @@ -50,16 +50,16 @@ def sph2grd( data Pass in data with L, M, C[L,M], S[L,M] values by providing a file name to an ASCII data table, a 2-D - {table-classes}. - {outgrid} - {spacing} - {region} - {verbose} - {binary} - {header} - {incols} - {registration} - {cores} + $table_classes. + $outgrid + $spacing + $region + $verbose + $binary + $header + $incols + $registration + $cores Returns ------- diff --git a/pygmt/src/sphdistance.py b/pygmt/src/sphdistance.py index b213cfabbc8..6d4af6c46ec 100644 --- a/pygmt/src/sphdistance.py +++ b/pygmt/src/sphdistance.py @@ -46,7 +46,7 @@ def sphdistance( Full GMT docs at :gmt-docs:`sphdistance.html`. - {aliases} + $aliases - I = spacing - R = region - V = verbose @@ -56,13 +56,13 @@ def sphdistance( data Pass in (x, y) or (longitude, latitude) values by providing a file name to an ASCII data table, a 2-D - {table-classes}. + $table_classes. x/y : 1-D arrays Arrays of x and y coordinates. - {outgrid} - {spacing} - {region} - {verbose} + $outgrid + $spacing + $region + $verbose single_form : bool For large data sets you can save some memory (at the expense of more processing) by only storing one form of location coordinates diff --git a/pygmt/src/sphinterpolate.py b/pygmt/src/sphinterpolate.py index ee09240cff8..d02309731d5 100644 --- a/pygmt/src/sphinterpolate.py +++ b/pygmt/src/sphinterpolate.py @@ -49,11 +49,11 @@ def sphinterpolate( data Pass in (x, y, z) or (longitude, latitude, elevation) values by providing a file name to an ASCII data table, a 2-D - {table-classes}. - {outgrid} - {spacing} - {region} - {verbose} + $table_classes. + $outgrid + $spacing + $region + $verbose Returns ------- diff --git a/pygmt/src/subplot.py b/pygmt/src/subplot.py index 8916d0edbb7..4df32ed38fb 100644 --- a/pygmt/src/subplot.py +++ b/pygmt/src/subplot.py @@ -52,7 +52,7 @@ def subplot( Full GMT docs at :gmt-docs:`subplot.html#synopsis-begin-mode`. - {aliases} + $aliases - B = frame - J = projection - M = margins @@ -96,7 +96,7 @@ def subplot( lowercase Roman numerals; use **+R** for uppercase Roman numerals [Default is Arabic numerals]. Append **+v** to increase tag numbers vertically down columns [Default is horizontally across rows]. - {frame} + $frame clearance : str or list [*side*]\ *clearance*. Reserve a space of dimension *clearance* between the margin and the @@ -109,7 +109,7 @@ def subplot( side and 2 cm on south side). Such space will be left untouched by the main map plotting but can be accessed by methods that plot scales, bars, text, etc. - {projection} + $projection margins Margin space that is added between neighboring subplots (i.e., the interior margins) in addition to the automatic space added for tick marks, annotations, @@ -124,7 +124,7 @@ def subplot( The actual gap created is always a sum of the margins for the two opposing sides (e.g., east plus west or south plus north margins) [Default is half the primary annotation font size, giving the full annotation font size as the default gap]. - {region} + $region sharex : bool or str Set subplot layout for shared x-axes. Use when all subplots in a column share a common *x*-range. If ``sharex=True``, the first (i.e., @@ -157,7 +157,7 @@ def subplot( While individual subplots can have titles (see ``sharex``/``sharey`` or ``frame``), the entire figure may also have an overarching *heading* [no heading]. Font is determined by setting :gmt-term:`FONT_HEADING`. - {verbose} + $verbose """ self._activate_figure() @@ -223,7 +223,7 @@ def set_panel( both dimensions then you must specify ``projection="x"`` [The default ``projection="X"`` will fill the subplot by using unequal scales]. - {aliases} + $aliases - V = verbose Parameters @@ -257,7 +257,7 @@ def set_panel( clearances set by ``clearance`` in the initial :meth:`pygmt.Figure.subplot` call. - {verbose} + $verbose """ self._activate_figure() diff --git a/pygmt/src/surface.py b/pygmt/src/surface.py index 01fb764f614..d2eb952ed25 100644 --- a/pygmt/src/surface.py +++ b/pygmt/src/surface.py @@ -75,7 +75,7 @@ def surface( Full GMT docs at :gmt-docs:`surface.html`. - {aliases} + $aliases - I = spacing - R = region - V = verbose @@ -86,20 +86,20 @@ def surface( data Pass in (x, y, z) or (longitude, latitude, elevation) values by providing a file name to an ASCII data table, a 2-D - {table-classes}. + $table_classes. x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. - {spacing} + $spacing - {region} - {outgrid} + $region + $outgrid convergence : float Optional. Convergence limit. Iteration is assumed to have converged when the maximum absolute change in any grid value is less than ``convergence``. (Units same as data z units). Alternatively, give limit in percentage of root-mean-square (rms) deviation by - appending %. [Default is scaled to :math:`10^{{-4}}` of the rms + appending %. [Default is scaled to :math:`10^{-4}` of the rms deviation of the data from a best-fit (least-squares) plane.] This is the final convergence limit at the desired grid spacing; for intermediate (coarser) grids the effective convergence limit is @@ -138,16 +138,16 @@ def surface( set boundary tension. If you do not prepend **i** or **b**, both will be set to the same value. [Default is 0 for both and gives minimum curvature solution.] - {verbose} - {aspatial} - {binary} - {nodata} - {find} - {coltypes} - {header} - {incols} - {registration} - {wrap} + $verbose + $aspatial + $binary + $nodata + $find + $coltypes + $header + $incols + $registration + $wrap Returns ------- diff --git a/pygmt/src/ternary.py b/pygmt/src/ternary.py index f9b79c0f2be..9f2adc41051 100644 --- a/pygmt/src/ternary.py +++ b/pygmt/src/ternary.py @@ -41,7 +41,7 @@ def ternary( # noqa: PLR0913 Full GMT docs at :gmt-docs:`ternary.html`. - {aliases} + $aliases - B = frame - L = alabel/blabel/clabel - R = region @@ -54,7 +54,7 @@ def ternary( # noqa: PLR0913 ---------- data Pass in either a file name to an ASCII data table, a Python list, a 2-D - {table-classes}. + $table_classes. 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 @@ -65,8 +65,8 @@ def ternary( # noqa: PLR0913 [*amin*, *amax*, *bmin*, *bmax*, *cmin*, *cmax*]. Give the min and max limits for each of the three axes **a**, **b**, and **c**. - {cmap} - {fill} + $cmap + $fill alabel Set the label for the *a* vertex where the component is 100%. The label is placed at a distance of three times the :gmt-term:`MAP_LABEL_OFFSET` setting @@ -78,11 +78,11 @@ def ternary( # noqa: PLR0913 style : str *symbol*\[\ *size*]. Plot individual symbols in a ternary diagram. - {pen} - {verbose} - {panel} - {perspective} - {transparency} + $pen + $verbose + $panel + $perspective + $transparency """ self._activate_figure() diff --git a/pygmt/src/text.py b/pygmt/src/text.py index 900bda554c9..156dd616a92 100644 --- a/pygmt/src/text.py +++ b/pygmt/src/text.py @@ -71,7 +71,7 @@ def text_( # noqa: PLR0912, PLR0913, PLR0915 Full GMT docs at :gmt-docs:`text.html`. - {aliases} + $aliases - B = frame - F = **+a**: angle, **+c**: position, **+j**: justify, **+f**: font - J = projection @@ -133,8 +133,8 @@ def text_( # noqa: PLR0912, PLR0913, PLR0915 e.g., **BL** for Bottom Left. If no justification is explicitly given (i.e. ``justify=True``), then the input to ``textfiles`` must have this as a column. - {projection} - {region} + $projection + $region *Required if this is the first plot command.* clearance : str [*dx/dy*][**+to**\|\ **O**\|\ **c**\|\ **C**]. @@ -167,21 +167,21 @@ def text_( # noqa: PLR0912, PLR0913, PLR0915 (see ``clearance``) [Default is ``"0.25p,black,solid"``]. no_clip Do **not** clip text at the frame boundaries [Default is ``False``]. - {verbose} - {aspatial} - {panel} - {find} - {coltypes} - {header} + $verbose + $aspatial + $panel + $find + $coltypes + $header use_word : int Select a specific word from the trailing text, with the first word being 0 [Default is the entire trailing text]. No numerical columns can be specified. - {perspective} - {transparency} + $perspective + $transparency ``transparency`` can also be a 1-D array to set varying transparency for texts, but this option is only valid if using ``x``/``y`` and ``text``. - {wrap} + $wrap """ self._activate_figure() diff --git a/pygmt/src/tilemap.py b/pygmt/src/tilemap.py index d1484f7e410..deef5ca3188 100644 --- a/pygmt/src/tilemap.py +++ b/pygmt/src/tilemap.py @@ -52,7 +52,7 @@ def tilemap( # noqa: PLR0913 ``lonlat=True``. If reprojection is not desired, please set ``lonlat=False`` and provide Spherical Mercator (EPSG:3857) coordinates to the ``region`` parameter. - {aliases} + $aliases - B = frame - J = projection - M = monochrome @@ -87,8 +87,8 @@ def tilemap( # noqa: PLR0913 tile providers. Default is ``xyzservices.providers.OpenStreetMap.HOT``, i.e. OpenStreetMap Humanitarian web tiles. - A web tile provider in the form of a URL. The placeholders for the XYZ in the - URL need to be ``{{x}}``, ``{{y}}``, ``{{z}}``, respectively. E.g. - ``https://{{s}}.tile.openstreetmap.org/{{z}}/{{x}}/{{y}}.png``. + URL need to be ``{x}``, ``{y}``, ``{z}``, respectively. E.g. + ``https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png``. - A local file path. The file is read with :doc:`rasterio ` and all bands are loaded into the basemap. See :doc:`contextily:working_with_local_files`. diff --git a/pygmt/src/triangulate.py b/pygmt/src/triangulate.py index 7a058af394e..0fb5eeb003d 100644 --- a/pygmt/src/triangulate.py +++ b/pygmt/src/triangulate.py @@ -99,7 +99,7 @@ def regular_grid( # noqa: PLR0913 Full GMT docs at :gmt-docs:`triangulate.html`. - {aliases} + $aliases - I = spacing - J = projection - R = region @@ -114,26 +114,26 @@ def regular_grid( # noqa: PLR0913 data Pass in (x, y[, z]) or (longitude, latitude[, elevation]) values by providing a file name to an ASCII data table, a 2-D - {table-classes}. - {projection} - {region} - {spacing} - {outgrid} + $table_classes. + $projection + $region + $spacing + $outgrid The interpolation is performed in the original coordinates, so if your triangles are close to the poles you are better off projecting all data to a local coordinate system before using ``triangulate`` (this is true of all gridding routines) or instead select :gmt-docs:`sphtriangulate `. - {verbose} - {binary} - {nodata} - {find} - {coltypes} - {header} - {incols} - {registration} - {skiprows} - {wrap} + $verbose + $binary + $nodata + $find + $coltypes + $header + $incols + $registration + $skiprows + $wrap Returns ------- @@ -220,7 +220,7 @@ def delaunay_triples( # noqa: PLR0913 Full GMT docs at :gmt-docs:`triangulate.html` - {aliases} + $aliases - I = spacing - J = projection - R = region @@ -235,20 +235,20 @@ def delaunay_triples( # noqa: PLR0913 data Pass in (x, y, z) or (longitude, latitude, elevation) values by providing a file name to an ASCII data table, a 2-D - {table-classes}. - {projection} - {region} - {output_type} - {outfile} - {verbose} - {binary} - {nodata} - {find} - {coltypes} - {header} - {incols} - {skiprows} - {wrap} + $table_classes. + $projection + $region + $output_type + $outfile + $verbose + $binary + $nodata + $find + $coltypes + $header + $incols + $skiprows + $wrap Returns ------- diff --git a/pygmt/src/velo.py b/pygmt/src/velo.py index 9610f2c2cb6..33c0373b710 100644 --- a/pygmt/src/velo.py +++ b/pygmt/src/velo.py @@ -60,7 +60,7 @@ def velo( # noqa : PLR0913 Full GMT docs at :gmt-docs:`supplements/geodesy/velo.html`. - {aliases} + $aliases - B = frame - J = projection - N = no_clip @@ -75,7 +75,7 @@ def velo( # noqa : PLR0913 ---------- data Pass in either a file name to an ASCII data table, a 2-D - {table-classes}. + $table_classes. Note that text columns are only supported with file or :class:`pandas.DataFrame` inputs. @@ -170,15 +170,15 @@ def velo( # noqa : PLR0913 with extension taken positive. - **5**: azimuth of eps2 in degrees CW from North. - {projection} - {region} + $projection + $region vector : bool or str Modify vector parameters. For vector heads, append vector head *size* [Default is 9p]. See :gmt-docs:`supplements/geodesy/velo.html#vector-attributes` for specifying additional attributes. - {frame} - {cmap} + $frame + $cmap rescale : str Can be used to rescale the uncertainties of velocities (``spec="e"`` and ``spec="r"``) and rotations (``spec="w"``). Can be combined with @@ -224,7 +224,7 @@ def velo( # noqa : PLR0913 no_clip Do **not** skip symbols that fall outside the frame boundaries [Default is ``False``, i.e., plot symbols inside the frame boundaries only]. - {verbose} + $verbose pen : str [*pen*][**+c**\ [**f**\|\ **l**]]. Set pen attributes for velocity arrows, ellipse circumference and fault @@ -242,13 +242,13 @@ def velo( # noqa : PLR0913 required columns). To instead use the corresponding error estimates (i.e., vector or rotation uncertainty) to lookup the color and paint the error ellipse or wedge instead, append **+e**. - {panel} - {nodata} - {find} - {header} - {incols} - {perspective} - {transparency} + $panel + $nodata + $find + $header + $incols + $perspective + $transparency """ self._activate_figure() diff --git a/pygmt/src/which.py b/pygmt/src/which.py index b60952f77b3..4790a3bd510 100644 --- a/pygmt/src/which.py +++ b/pygmt/src/which.py @@ -36,7 +36,7 @@ def which( Full GMT docs at :gmt-docs:`gmtwhich.html`. - {aliases} + $aliases - V = verbose Parameters @@ -56,7 +56,7 @@ def which( where GMT normally places downloaded files), **c** to place it in the user cache directory, or **u** for the user data directory instead (i.e., ignoring any subdirectory structure). - {verbose} + $verbose Returns ------- diff --git a/pygmt/src/wiggle.py b/pygmt/src/wiggle.py index 7011c50c7f1..dd407acb9b1 100644 --- a/pygmt/src/wiggle.py +++ b/pygmt/src/wiggle.py @@ -81,7 +81,7 @@ def wiggle( # noqa: PLR0913 Full GMT docs at :gmt-docs:`wiggle.html`. - {aliases} + $aliases - B = frame - G = **+p**: fillpositive, **+n**: fillnegative - J = projection @@ -98,17 +98,17 @@ def wiggle( # noqa: PLR0913 The arrays of x and y coordinates and z data points. data Pass in either a file name to an ASCII data table, a 2-D - {table-classes}. + $table_classes. Use parameter ``incols`` to choose which columns are x, y, z, respectively. - {projection} - {region} + $projection + $region scale : str or float Give anomaly scale in data-units/distance-unit. Append **c**, **i**, or **p** to indicate the distance unit (centimeters, inches, or points); if no unit is given we use the default unit that is controlled by :gmt-term:`PROJ_LENGTH_UNIT`. - {frame} + $frame position : str [**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\ **+w**\ *length*\ [**+j**\ *justify*]\ [**+al**\|\ **r**]\ @@ -121,20 +121,20 @@ def wiggle( # noqa: PLR0913 track : str Draw track [Default is no track]. Append pen attributes to use [Default is ``"0.25p,black,solid"``]. - {verbose} + $verbose pen : str Specify outline pen attributes [Default is no outline]. - {binary} - {panel} - {nodata} - {find} - {coltypes} - {gap} - {header} - {incols} - {perspective} - {transparency} - {wrap} + $binary + $panel + $nodata + $find + $coltypes + $gap + $header + $incols + $perspective + $transparency + $wrap """ self._activate_figure() diff --git a/pygmt/src/x2sys_cross.py b/pygmt/src/x2sys_cross.py index 50f47b36c42..f7b8d91c283 100644 --- a/pygmt/src/x2sys_cross.py +++ b/pygmt/src/x2sys_cross.py @@ -90,7 +90,7 @@ def x2sys_cross( Full GMT docs at :gmt-docs:`supplements/x2sys/x2sys_cross.html`. - {aliases} + $aliases - R = region - V = verbose @@ -159,7 +159,7 @@ def x2sys_cross( Use **e** for external COEs only, and **i** for internal COEs only [Default is all COEs]. - {region} + $region speed : str or list **l**\|\ **u**\|\ **h**\ *speed*. @@ -176,7 +176,7 @@ def x2sys_cross( speed of 0, upper speed of 10, and disable heading calculations for speeds below 5. - {verbose} + $verbose numpoints : int Give the maximum number of data points on either side of the crossover diff --git a/pygmt/src/x2sys_init.py b/pygmt/src/x2sys_init.py index 78734e7753e..a7ff867fa55 100644 --- a/pygmt/src/x2sys_init.py +++ b/pygmt/src/x2sys_init.py @@ -43,7 +43,7 @@ def x2sys_init( Full GMT docs at :gmt-docs:`supplements/x2sys/x2sys_init.html`. - {aliases} + $aliases - I = spacing - R = region - V = verbose @@ -106,8 +106,8 @@ def x2sys_init( [Default is ``units=["dk", "se"]`` (km and m/s) if ``discontinuity`` is set, and ``units=["dc", "sc"]`` otherwise (e.g., for Cartesian units)]. - {region} - {verbose} + $region + $verbose gap : str or list **t**\|\ **d**\ *gap*. @@ -118,7 +118,7 @@ def x2sys_init( If these limits are exceeded then a data gap is assumed and no COE will be determined. - {distcalc} + $distcalc """ aliasdict = AliasSystem( I=Alias(spacing, name="spacing", sep="/", size=2), diff --git a/pygmt/src/xyz2grd.py b/pygmt/src/xyz2grd.py index bc2d13d8e6b..ab1f9f59b10 100644 --- a/pygmt/src/xyz2grd.py +++ b/pygmt/src/xyz2grd.py @@ -52,7 +52,7 @@ def xyz2grd( Full GMT docs at :gmt-docs:`xyz2grd.html`. - {aliases} + $aliases - I = spacing - J = projection - R = region @@ -63,10 +63,10 @@ def xyz2grd( ---------- data Pass in (x, y, z) or (longitude, latitude, elevation) values by - providing a file name to an ASCII data table, a 2-D {table-classes}. + providing a file name to an ASCII data table, a 2-D $table_classes. x/y/z : 1-D arrays The arrays of x and y coordinates and z data points. - {outgrid} + $outgrid duplicate : str [**d**\|\ **f**\|\ **l**\|\ **m**\|\ **n**\|\ **r**\|\ **S**\|\ **s**\|\ **u**\|\ **z**]. @@ -82,10 +82,10 @@ def xyz2grd( that were assigned to each node (this only requires two input columns *x* and *y* as *z* is not consulted). Append **z** to sum multiple values that belong to the same node. - {spacing} - {projection} - {region} - {verbose} + $spacing + $projection + $region + $verbose convention : str [*flags*]. Read a 1-column ASCII [or binary] table. This assumes that all the @@ -126,14 +126,14 @@ def xyz2grd( each input record to have a single value, while the former can handle multiple values per record but can only parse regular floating point values. Translate incoming *z*-values via the ``incols`` parameter. - {binary} - {nodata} - {find} - {coltypes} - {header} - {incols} - {registration} - {wrap} + $binary + $nodata + $find + $coltypes + $header + $incols + $registration + $wrap Returns -------