Skip to content

Commit 65d057c

Browse files
committed
Alias background (D), overrule_bg (M) and no_bg (N)
1 parent 916bbbf commit 65d057c

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

pygmt/mathops.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@
1010
@use_alias(
1111
A="transparency",
1212
C="cmap",
13+
D="background",
1314
F="color_model",
1415
G="truncate",
1516
H="output",
1617
I="reverse",
18+
M="overrule_bg",
19+
N="no_bg",
1720
Q="log",
1821
T="series",
1922
V="verbose",
@@ -28,8 +31,8 @@ def makecpt(**kwargs):
2831
This is a module that will help you make static color palette tables
2932
(CPTs). In classic mode we write the CPT to standard output, while under
3033
modern mode we simply save the CPT as the current session CPT (but see
31-
**output**). You define an equidistant set of contour intervals or pass
32-
your own z-table or list, and create a new CPT based on an existing master
34+
*output*). You define an equidistant set of contour intervals or pass your
35+
own z-table or list, and create a new CPT based on an existing master
3336
(dynamic) CPT. The resulting CPT can be reversed relative to the master
3437
cpt, and can be made continuous or discrete. For color tables beyond the
3538
standard GMT offerings, visit
@@ -46,14 +49,14 @@ def makecpt(**kwargs):
4649
the new master file. If not, the parameters :gmt-term:`COLOR_BACKGROUND`,
4750
:gmt-term:`COLOR_FOREGROUND`, and :gmt-term:`COLOR_NAN` from the
4851
:gmt-docs:`gmt.conf <gmt.conf>` file or the command line will be used. This
49-
default behavior can be overruled using the options **-D**, **-M** or
50-
**-N**.
52+
default behavior can be overruled using the options *background*,
53+
*overrule_bg* or *no_bg*.
5154
5255
The color model (RGB, HSV or CMYK) of the palette created by **makecpt**
5356
will be the same as specified in the header of the master CPT. When there
5457
is no :gmt-term:`COLOR_MODEL` entry in the master CPT, the
55-
:gmt-term:`COLOR_MODEL` specified in the :doc:`gmt.conf` file or on the
56-
command line will be used.
58+
:gmt-term:`COLOR_MODEL` specified in the :gmt-docs:`gmt.conf <gmt.conf>`
59+
file or on the command line will be used.
5760
5861
Full option list at :gmt-docs:`makecpt.html`
5962
@@ -69,6 +72,14 @@ def makecpt(**kwargs):
6972
Selects the master color palette table (CPT) to use in the
7073
interpolation. Full list of built-in color palette tables can be found
7174
at :gmt-docs:`cookbook/cpts.html#built-in-color-palette-tables-cpt`.
75+
background : bool or str
76+
Select the back- and foreground colors to match the colors for lowest
77+
and highest *z*-values in the output CPT [Default (``background=True``
78+
or ``background='o'``) uses the colors specified in the master file, or
79+
those defined by the parameters :gmt-term:`COLOR_BACKGROUND`,
80+
:gmt-term:`COLOR_FOREGROUND`, and :gmt-term:`COLOR_NAN`]. Use
81+
``background='i'`` to match the colors for the lowest and highest
82+
values in the input (instead of the output) CPT.
7283
color_model :
7384
``[R|r|h|c][+c[label]]``.
7485
Force output CPT to be written with r/g/b codes, gray-scale values or
@@ -107,6 +118,15 @@ def makecpt(**kwargs):
107118
happens before *truncate* and *series* values are used so the latter
108119
must be compatible with the changed *z*-range. See also
109120
:gmt-docs:`cookbook/features.html#manipulating-cpts`.
121+
overrule_bg :
122+
Overrule background, foreground, and NaN colors specified in the master
123+
CPT with the values of the parameters :gmt-term:`COLOR_BACKGROUND`,
124+
:gmt-term:`COLOR_FOREGROUND`, and :gmt-term:`COLOR_NAN` specified in
125+
the :gmt-docs:`gmt.conf <gmt.conf>` file or on the command line. When
126+
combined with **background**, only :gmt-term:`COLOR_NAN` is considered.
127+
no_bg : bool
128+
Do not write out the background, foreground, and NaN-color fields
129+
[Default will write them, i.e. ``no_bg=False``].
110130
log : bool
111131
For logarithmic interpolation scheme with input given as logarithms.
112132
Expects input z-values provided via **series** to be log10(*z*),

0 commit comments

Comments
 (0)