.\" Man page generated from reStructuredText. . .TH "MAKECPT" "1gmt" "Sep 07, 2019" "6.0.0rc4" "GMT" .SH NAME makecpt \- Make GMT color palette tables . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH SYNOPSIS .sp \fBgmt makecpt\fP [ \fB\-A\fP\fItransparency\fP[\fB+a\fP] ] [ \fB\-C\fP\fIcpt\fP ] [ \fB\-D\fP[\fBi\fP|\fBo\fP] ] [ \fB\-E\fP[\fInlevels\fP] ] [ \fB\-F\fP[\fBR\fP|\fBr\fP|\fBh\fP|\fBc\fP][\fB+c\fP]] [ \fB\-G\fP\fIzlo\fP/\fIzhi\fP ] [ \fB\-H\fP ] [ \fB\-I\fP[\fBc\fP][\fBz\fP] ] [ \fB\-M\fP ] [ \fB\-N\fP ] [ \fB\-Q\fP ] [ \fB\-S\fP\fImode\fP ] [ \fB\-T\fP[\fImin\fP/\fImax\fP/\fIinc\fP[\fB+n\fP]|\fIfile\fP|\fIlist\fP] ] [ \fB\-V\fP[\fIlevel\fP] ] [ \fB\-W\fP[\fBw\fP] ] [ \fB\-Z\fP ] [ \fB\-bi\fPbinary ] [ \fB\-di\fPnodata ] [ \fB\-i\fPflags ] [ \fB\-\-PAR\fP=\fIvalue\fP ] .sp \fBNote:\fP No space is allowed between the option flag and the associated arguments. .SH DESCRIPTION .sp \fBmakecpt\fP is a module that will help you make static color palette tables (CPTs). In classic mode we write the CMT to standard output, while under modern mode we simply save the CPT as the current session CPT (but see \fB\-H\fP). You define an equidistant set of contour intervals or pass your own z\-table or list, and create a new CPT based on an existing master (dynamic) CPT. The resulting CPT can be reversed relative to the master cpt, and can be made continuous or discrete. For color tables beyond the standard GMT offerings, visit \fI\%cpt\-city\fP and \fI\%Scientific Colour\-Maps\fP\&. .sp The CPT includes three additional colors beyond the range of z\-values. These are the background color (B) assigned to values lower than the lowest \fIz\fP\-value, the foreground color (F) assigned to values higher than the highest \fIz\fP\-value, and the NaN color (N) painted wherever values are undefined. .sp If the master CPT includes B, F, and N entries, these will be copied into the new master file. If not, the parameters COLOR_BACKGROUND, COLOR_FOREGROUND, and COLOR_NAN from the gmt.conf file or the command line will be used. This default behavior can be overruled using the options \fB\-D\fP, \fB\-M\fP or \fB\-N\fP\&. .sp The color model (RGB, HSV or CMYK) of the palette created by \fBmakecpt\fP will be the same as specified in the header of the master CPT. When there is no COLOR_MODEL entry in the master CPT, the COLOR_MODEL specified in the gmt.conf file or on the command line will be used. .SH REQUIRED ARGUMENTS .sp None. .SH OPTIONAL ARGUMENTS .INDENT 0.0 .TP \fB\-A\fP\fItransparency\fP[\fB+a\fP] Sets a constant level of transparency (0\-100) for all color slices. Append \fB+a\fP to also affect the fore\-, back\-, and nan\-colors [Default is no transparency, i.e., 0 (opaque)]. .UNINDENT .INDENT 0.0 .TP \fB\-C\fP\fIcpt\fP Selects the master color table CPT to use in the interpolation. Choose among the built\-in tables (type \fBmakecpt\fP to see the list) or give the name of an existing CPT [Default gives the turbo CPT]. Yet another option is to specify \-Ccolor1,color2[,color3,...] to build a linear continuous cpt from those colors automatically. In this case \fIcolor\fP\fBn\fP can be a r/g/b triplet, a color name, or an HTML hexadecimal color (e.g. #aabbcc ). .UNINDENT .INDENT 0.0 .TP \fB\-D\fP[\fBi\fP|\fBo\fP] Select the back\- and foreground colors to match the colors for lowest and highest \fIz\fP\-values in the output CPT [Default uses the colors specified in the master file, or those defined by the parameters COLOR_BACKGROUND, COLOR_FOREGROUND, and COLOR_NAN]. Append \fBi\fP to match the colors for the lowest and highest values in the input (instead of the output) CPT. .UNINDENT .INDENT 0.0 .TP \fB\-E\fP[\fInlevels\fP] Implies reading data table(s) from given command\-line files or standard input. We use the last data column to determine the data range; use \fB\-i\fP to select another column, and use \fB\-bi\fP if your data table is native binary. This z\-range information is used instead of providing the \fB\-T\fP option. We create a linear color table by dividing the table data z\-range into \fInlevels\fP equidistant slices. If \fInlevels\fP is not given it defaults to the number of levels in the chosen CPT. .UNINDENT .INDENT 0.0 .TP \fB\-F\fP[\fBR\fP|\fBr\fP|\fBh\fP|\fBc\fP][\fB+c\fP]] Force output CPT to be written with r/g/b codes, gray\-scale values or color name (\fBR\fP, default) or r/g/b codes only (\fBr\fP), or h\-s\-v codes (\fBh\fP), or c/m/y/k codes (\fBc\fP). Optionally or alternatively, append \fB+c\fP to write discrete palettes in categorical format. .UNINDENT .INDENT 0.0 .TP \fB\-G\fP\fIzlo\fP/\fIzhi\fP Truncate the incoming CPT so that the lowest and highest z\-levels are to \fIzlo\fP and \fIzhi\fP\&. If one of these equal NaN then we leave that end of the CPT alone. The truncation takes place before any resampling. See also manipulating_CPTs .UNINDENT .INDENT 0.0 .TP \fB\-H\fP Modern mode only: Write the CPT to standard output as well [Default saves the CPT as the session current CPT]. Required for scripts used to make animations via movie where we must pass named CPT files. .UNINDENT .INDENT 0.0 .TP \fB\-I\fP[\fBc\fP][\fBz\fP] Append \fBc\fP [Default] to reverse the sense of color progression in the master CPT. Also exchanges the foreground and background colors, including those specified by the parameters COLOR_BACKGROUND and COLOR_FOREGROUND\&. Append \fBz\fP to reverse the sign of z\-values in the color table. Note that this change of \fIz\fP\-direction happens before \fB\-G\fP and \fB\-T\fP values are used so the latter much be compatible with the changed \fIz\fP\-range. See also manipulating_CPTs .UNINDENT .INDENT 0.0 .TP \fB\-M\fP Overrule background, foreground, and NaN colors specified in the master CPT with the values of the parameters COLOR_BACKGROUND, COLOR_FOREGROUND, and COLOR_NAN specified in the gmt.conf file or on the command line. When combined with \fB\-D\fP, only COLOR_NAN is considered. .UNINDENT .INDENT 0.0 .TP \fB\-N\fP Do not write out the background, foreground, and NaN\-color fields [Default will write them]. .UNINDENT .INDENT 0.0 .TP \fB\-Q\fP For logarithmic interpolation scheme with input given as logarithms. Expects input z\-values provided via \fB\-T\fP to be log10(\fIz\fP), assigns colors, and writes out \fIz\fP\&. .UNINDENT .INDENT 0.0 .TP \fB\-S\fP\fImode\fP Determine a suitable range for the \fB\-T\fP option from the input table(s) (or stdin). Choose from several types of range determinations: \fB\-Sr\fP will use the data range min/max, \fB\-S\fP\fIinc\fP[\fB+d\fP] will use the data min/max but rounded to nearest \fIinc\fP (append \fB+d\fP to resample to a discrete CPT), \fB\-Sa\fP\fIscl\fP will make a symmetric range around the average (i.e., mean) and ±\fIscl\fP * \fIsigma\fP, \fB\-Sm\fP\fIscl\fP will make a symmetric range around the median and ±\fIscl\fP * \fIL1_scale\fP, \fB\-Sp\fP\fIscl\fP will make symmetric range around mode and ±\fIscl\fP * \fILMS_scale\fP, while \fB\-Sq\fP\fIlow/high\fP sets the range from \fIlow\fP quartile to \fIhigh\fP quartile (in percentages). We use the last data column for this calculation; use \fBi\fP if you need to adjust the column orders. .UNINDENT .INDENT 0.0 .TP \fB\-T\fP[\fImin\fP/\fImax\fP/\fIinc\fP[\fB+b\fP|\fBl\fP|\fBn\fP]|\fIfile\fP|\fIlist\fP] Defines the range of the new CPT by giving the lowest and highest z\-value (and optionally an interval). If \fB\-T\fP is not given, the existing range in the master CPT will be used intact. The values produces defines the color slice boundaries. If \fB+n\fP is used it refers to the number of such boundaries and not the number of slices. For details on array creation, see \fI\%Generate 1D Array\fP\&. .UNINDENT .INDENT 0.0 .TP \fB\-V\fP[\fIlevel\fP] (more ...) Select verbosity level [c]. .UNINDENT .INDENT 0.0 .TP \fB\-W\fP[\fBw\fP] Do not interpolate the input color table but pick the output colors starting at the beginning of the color table, until colors for all intervals are assigned. This is particularly useful in combination with a categorical color table, like "categorical". Cannot be used in combination with \fB\-Z\fP\&. Alternatively, use \fB\-Ww\fP to produce a wrapped (cyclic) color table that endlessly repeats its range. .UNINDENT .INDENT 0.0 .TP \fB\-Z\fP Creates a continuous CPT [Default is discontinuous, i.e., constant colors for each interval]. This option has no effect when no \fB\-T\fP is used, or when using \fB\-T\fP\fIz_min\fP/\fIz_max\fP; in the first case the input CPT remains untouched, in the second case it is only scaled to match the range \fIz_min\fP/\fIz_max\fP\&. .UNINDENT .INDENT 0.0 .TP \fB\-bi\fP[\fIncols\fP][\fBt\fP] (more ...) Select native binary format for primary input. [Default is the required number of columns given the chosen settings]. .UNINDENT .INDENT 0.0 .TP \fB\-di\fP\fInodata\fP (more ...) Replace input columns that equal \fInodata\fP with NaN. .UNINDENT .INDENT 0.0 .TP \fB\-i\fP\fIcols\fP[\fB+l\fP][\fB+s\fP\fIscale\fP][\fB+o\fP\fIoffset\fP][,\fI\&...\fP][,\fIt\fP[\fIword\fP]] (more ...) Select input columns and transformations (0 is first column, \fIt\fP is trailing text, append \fIword\fP to read one word only). .UNINDENT .INDENT 0.0 .TP \fB\-^\fP or just \fB\-\fP Print a short message about the syntax of the command, then exits (NOTE: on Windows just use \fB\-\fP). .TP \fB\-+\fP or just \fB+\fP Print an extensive usage (help) message, including the explanation of any module\-specific option (but not the GMT common options), then exits. .TP \fB\-?\fP or no arguments Print a complete usage (help) message, including the explanation of all options, then exits. .TP \fB\-\-PAR\fP=\fIvalue\fP Temporarily override a GMT default setting; repeatable. See /gmt.conf for parameters. .UNINDENT .SH NOTES ON TRANSPARENCY .sp The PostScript language originally had no accommodation for transparency. However, Adobe added an extension that allows developers to encode some forms of transparency using the PostScript language model but it is only realized when converting the PostScript to PDF (and via PDF to any raster image format). GMT uses this model but there are some limitations: Transparency can only be controlled on a per\-object or per\-layer basis. This means that a color specifications (such as those in CPTs of given via command\-line options) only apply to vector graphic items (i.e., text, lines, polygon fills) or to an entire layer (which could include items such as PostScript images). This limitation rules out any mechanism of controlling transparency in such images on a pixel level. .SH GENERATE 1D ARRAY .sp Make an evenly spaced coordinate array from \fImin\fP to \fImax\fP in steps of \fIinc\fP\&. Append \fB+b\fP if we should take log2 of \fImin\fP and \fImax\fP and build an equidistant log2\-array using \fIinc\fP integer increments in log2. Append \fB+l\fP if we should take log10 of \fImin\fP and \fImax\fP and build an array where \fIinc\fP can be 1 (every magnitude), 2, (1, 2, 5 times magnitude) or 3 (1\-9 times magnitude). For less than every magnitude, use a negative integer \fIinc\fP\&. Append \fB+n\fP if \fIinc\fP is meant to indicate the number of equidistant coordinates instead. Alternatively, give a \fIfile\fP with output coordinates in the first column, or provide a comma\-separated \fIlist\fP of coordinates. If you only want a \fIsingle\fP value then you must append a comma to distinguish the list from the setting of \fIinc\fP\&. .sp If the module allows you to set up an absolute time series, append a valid time unit from the list \fBy\fPear, m\fBo\fPnth, \fBw\fPeek, \fBd\fPay, \fBh\fPour, \fBm\fPinute, and \fBs\fPecond to the given increment; add \fB+t\fP to ensure time column (or use \fB\-f\fP) Note: The internal time unit is still controlled independently by TIME_UNIT\&. Some modules allow for \fB+a\fP which will paste the coordinate array to the output table. .sp Likewise, if the module allows you to set up a spatial distance series (with distance computed from the first two data columns), specify the increment as \fIinc\fP[\fIunit\fP] with a geospatial distance unit from the list \fBd\fPegree (arc), \fBm\fPinute (arc), \fBs\fPecond (arc), m\fBe\fPter, \fBf\fPoot, \fBk\fPilometer, \fBM\fPiles (statute), \fBn\fPautical miles, or s\fBu\fPrvey foot; see \fB\-j\fP for calculation mode. For Cartesian distances, you must use the special unit \fBc\fP\&. .sp Finally, if you are only providing an increment and obtain \fImin\fP and \fImax\fP from the data, then it is possible (\fImax\fP \- \fImin\fP)/\fIinc\fP is not an integer, as required. If so then \fIinc\fP will be adjusted to accordingly. Alternatively, append \fB+e\fP to keep \fIinc\fP exact and adjust \fImax\fP instead. .SH COLOR HINGES .sp Some of the GMT master dynamic CPTs are actually two separate CPTs meeting at a \fIhinge\fP\&. Usually, colors may change dramatically across the hinge, which is used to separate two different domains (e.g., land and ocean across the shoreline, for instance). CPTs with a hinge will have their two parts stretched to the required range separately, i.e., the bottom part up to the hinge will be stretched independently of the part from the hinge to the top, according to the prescribed new range. If the selected range does not include the hinge then no such partitioning takes place. .SH COLOR ALIASING .sp For best result when \fB\-T \-Z\fP is used we recommend you do no append a specific \fIz_inc\fP\&. This way the original CPT is used exactly as is but the \fIz\fP boundaries are adjusted to match the stated limits. Otherwise you may, depending on the nature of the input CPT, miss aspects of the color changes by aliasing the signal. .SH EXAMPLES .sp To make a CPT with z\-values from \-200 to 200, with discrete color changes every 25, and using a polar blue\-white\-red colortable: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt makecpt \-Cpolar \-T\-200/200/25 > colors.cpt .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp To make an equidistant CPT from z = \-2 to 6 using the continuous default turbo rainbow of colors: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt makecpt \-T\-2/6 \-Z > colors.cpt .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp To use the GEBCO look\-alike CPT with its default range for bathymetry, run .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt makecpt \-Cgebco > my_gebco.cpt .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp or simply use \-Cgebco directly in the application that needs the color table. To create a 24\-level color table suitable for plotting the depths in the data table depths.txt (with lon, lat, depths), run .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt makecpt \-Cgebco depths.txt \-i2 \-Z \-E24 > my_depths.cpt .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp To use the gebco color table but reverse the z\-values so it can be used for positive depth values, try .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt makecpt \-Cgebco \-Iz > my_positive_gebco.cpt .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp To make a custom discrete color table for depth of seismicity, using red color for hypocenters between 0 and 100 km, green for 100\-300 km, and blue for deep (300\-1000 km) earthquakes, use .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt makecpt \-Cred,green,blue \-T0,80,300,1000 \-N > seis.cpt .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp To make a continuous CPT from white to blue as z goes from 3 to 10, try .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt makecpt \-Cwhite,blue \-T3,10 \-Z > cold.cpt .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp To make a wrapped (cyclic) CPT from the jet table over the interval 0 to 500, i.e., the color will be wrapped every 500 z\-units so that we always get a color regardless of the \fIz\fP value, try .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt makecpt \-Cjet \-T0/500 \-Ww > wrapped.cpt .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SH NOTE ON CPTS IN MODERN MODE .sp In modern mode, CPTs are rarely needed to be named explicitly. Instead, when a module that may create a CPT, such as grd2cpt and makecpt (or even grdimage when no color table is available), the behavior under modern mode is to write that CPT to a hidden file in the session directory. When a module requires a CPT (e.g., \fBgrdimage\fP not given \fB\-C\fP or \fBplot\fP given \fB\-C\fP with no name) then we read this hidden CPT (if it exists). This file is called the \fIcurrent\fP CPT. In fact, there are several levels of current CPTs that may all be different, and some may not be present. If you create a CPT within an \fBinset\fP operation then that CPT is only accessible during the inset plotting; it thus only has the inset as its \fIscope\fP\&. If you create a CPT while positioned into a specific subplot, then that CPT is likewise only accessible to that subplot. If, on the other hand, you make a CPT after \fBsubplot begin\fP but before any plotting then that CPT is available to all the subplots (but can be locally overridden by a subplot\-specific CPT mention above). Finally, each call to \fBfigure\fP means you may have a figure\-specific CPT, should you create them. If none exists then the session CPT is used. The rule gmt follows is to always get the CPT with the most restricted scope that is visible from where you are in the plotting hierarchy. If not found we go up the hierarchy to CPTs with broader scope, and if none is ultimately found (and the module, unlike \fBgrdimage\fP, cannot create a CPT by itself), then you have likely made a scripting error. There are cases in modern mode when you must explicitly create a named CPT using the \fB\-H\fP option. One such case is when making movies with movie since you will want to create the CPT once and have \fBmovie\fP access it again and again. Since each movie frame is a \fIseparate session\fP there is no cross\-session sharing of current CPTs. .SH BUGS .sp Since \fBmakecpt\fP will also interpolate from any existing CPT you may have in your directory, you should not use one of the listed cpt names as an output filename; hence the my_gebco.cpt in the example. If you do create a CPT of such a name, e.g., rainbow.cpt, then \fBmakecpt\fP will read that file first and not look for the master CPT in the shared GMT directory. .SH SEE ALSO .sp gmt, grd2cpt .SH REFERENCES .sp Crameri, F., (2018). Scientific colour\-maps. Zenodo. \fI\%http://doi.org/10.5281/zenodo.1243862\fP .sp Crameri, F. (2018), Geodynamic diagnostics, scientific visualisation and StagLab 3.0, \fIGeosci. Model Dev.\fP, 11, 2541\-2562, doi:10.5194/gmd\-11\-2541\-2018. .SH COPYRIGHT 2019, The GMT Team .\" Generated by docutils manpage writer. .