psscale — GMT 5.1.1 documentation

### Navigation

- index
- next
- previous
- Project Home »
- GMT 5.1.1 documentation »
- PS »
- Search:

# psscale

psscale - Plot a gray or color scale-bar on maps

## Synopsis

psscale -Dxpos/ypos/length/width[h] [ -A[a|l|c] ] [ -B[p|s]parameters ] [ -Ccpt_file ] [ -E[b|f][length][+n[text]] ] [ -Gzlo/zhi ] [ -I[max_intens|low_i/high_i] ] [ -Jparameters ] [ -Jz|Zparameters ] [ -K ] [ -L[i][gap] ] [ -M ] [ -N[p|dpi ]] [ -O ] [ -P ] [ -Q ] [ -R[unit]xmin/xmax/ymin/ymax[r] ] [ -S ] [ -T[+ppen][+gfill][+l|r|b|toff] ] [ -U[just/dx/dy/][c|label] ] [ -V[level] ] [ -X[a|c|f|r][x-shift[u]] ] [ -Y[a|c|f|r][y-shift[u]] ] [ -Zzfile ] [ -ccopies ] [ -p[x|y|z]azim/elev[/zlevel][+wlon0/lat0[/z0]][+vx0/y0] ] [ -t[transp] ]

Note: No space is allowed between the option flag and the associated arguments.

## Description

psscale plots gray scales or color scales on maps. Both horizontal and vertical scales are supported. For cpt_files with gradational colors (i.e., the lower and upper boundary of an interval have different colors) psscale will interpolate to give a continuous scale. Variations in intensity due to shading/illumination may be displayed by setting the option -I. Colors may be spaced according to a linear scale, all be equal size, or by providing a file with individual tile widths. The font used for the annotations along the scale and optional units is specified by FONT_ANNOT_PRIMARY. If a label is requested, it is plotted with FONT_LABEL

## Required Arguments

-Dxpos/ypos/length/width[h]
  Defines the position of the center/top (for horizontal scale) or center/left (for vertical scale) and the dimensions of the scale. Give a negative length to reverse the scalebar. Append h to get a horizontal scale [Default is vertical].

## Optional Arguments

-A[a|l|c]
  Place annotations and labels above (instead of below) horizontal scalebars and to the left (instead of the right) of vertical scalebars. Append a or l to move only the annotations or the label to the other side. Append c if you want to print a vertical label as a column of characters (does not work with special characters).
-B[p|s]parameters
  Set annotation, tick, and gridline interval for the colorbar. The x-axis label will plot beneath a horizontal bar (or vertically to the right of a vertical bar), except when using -A. As an option, use the y-axis label to plot the data unit to the right of a horizontal bar (and above a vertical bar). When using -Ba or -Baf annotation and/or minor tick intervals are chosen automatically. If -B is omitted, or no annotation intervals are provided, the default is to annotate every color level based on the numerical entries in the cpt file (which may be overridden by ULB flags in the cpt file). To specify custom text annotations for intervals, you must append ;annotation to each z-slice in the cpt file.
-Ccpt_file
  cpt_file is the color palette file to be used. By default all color changes are annotated. To use a subset, add an extra column to the cpt-file with a L, U, or B to annotate Lower, Upper, or Both color segment boundaries (but see -B). If not given, psscale will read stdin. Like grdview, psscale can understand pattern specifications in the cpt file. For CPT files where the z range is in meters, it may be useful to change to another unit when plotting. To do so, append +Uunit to the file name. Likewise, if the CPT file uses another unit than meter and you wish to plot the CPT versus meters, append +uunit.
-E[b|f][length][+n[text]]
  Add sidebar triangles for back- and/or foreground colors. Add f or b for only one sidebar triangle [Default gives both]. Optionally, append triangle height [Default is half the barwidth]. Finally, you can plot a rectangle with the NaN color at the start of the bar, labeled with text [NaN].
-Gzlo/zhi
  Truncate the incoming CPT so that the lowest and highest z-levels are to zlo and zhi. If one of these equal NaN then we leave that end of the CPT alone. The truncation takes place before the plotting.
-I[max_intens|low_i/high_i]
  Add illumination effects. Optionally, set the range of intensities from - to + max_intens. If not specified, 1 is used. Alternatively, append low/high intensities to specify an asymmetric range [Default is no illumination].

-Jparameters (more ...)
  Select map projection.

-Jz|Zparameters (more ...)
  Set z-axis scaling; same syntax as -Jx.

-K (more ...)
  Do not finalize the PostScript plot.
-L[i][gap]
  Gives equal-sized color rectangles. Default scales rectangles according to the z-range in the cpt-file (Also see -Z). If set, any equal interval annotation set with -B will be ignored. If gap is appended and the cpt table is discrete we will center each annotation on each rectangle, using the lower boundary z-value for the annotation. If i is prepended we annotate the interval range instead. If -I is used then each rectangle will have its constant color modified by the specified intensity.
-M
  Force a monochrome graybar using the (television) YIQ transformation.
-N[p|dpi ]
  Controls how the color scale is represented by the PostScript language. To preferentially draw color rectangles (e.g., for discrete colors), append p. Otherwise we will preferentially draw images (e.g., for continuous colors). Optionally append effective dots-per-inch for rasterization of color scales [600].

-O (more ...)
  Append to existing PostScript plot.

-P (more ...)
  Select “Portrait” plot orientation.
-Q
  Select logarithmic scale and power of ten annotations. All z-values in the cpt file will be converted to p = log10(z) and only integer p values will be annotated using the 10^p format [Default is linear scale].

-Rwest/east/south/north[/zmin/zmax][r]
  west, east, south, and north specify the region of interest, and you may specify them in decimal degrees or in [+-]dd:mm[:ss.xxx][W|E|S|N] format. Append r if lower left and upper right map coordinates are given instead of w/e/s/n. The two shorthands -Rg and -Rd stand for global domain (0/360 and -180/+180 in longitude respectively, with -90/+90 in latitude). Alternatively, specify the name of an existing grid file and the -R settings (and grid spacing, if applicable) are copied from the grid. Using -Runit expects projected (Cartesian) coordinates compatible with chosen -J and we inversely project to determine actual rectangular geographic region. For perspective view (-p), optionally append /zmin/zmax. In case of perspective view (-p), a z-range (zmin, zmax) can be appended to indicate the third dimension. This needs to be done only when using the -Jz option, not when using only the -p option. In the latter case a perspective view of the plane is plotted, with no third dimension.

For perspective view p, optionally append /zmin/zmax. (more ...)

-S
  Do not separate different color intervals with black grid lines.
-T[+ppen][+gfill][+l|r|b|toff]
  Place a rectangle as background to the color scale. You must specify either a pen outline (with modifier +ppen) or a fill (with modifier +gfill), or both. The size of the rectangle is computed from -D and the current fontsize and offset parameters. You can add (or remove) additional space on any side by appending +soff, where s is one of left, right, bottom, or top.

-U[just/dx/dy/][c|label] (more ...)
  Draw GMT time stamp logo on plot.

-V[level] (more ...)
  Select verbosity level [c].

-X[a|c|f|r][x-shift[u]]

-Y[a|c|f|r][y-shift[u]] (more ...)
  Shift plot origin.
-Zzfile
  File with colorbar-width per color entry. By default, width of entry is scaled to color range, i.e., z = 0-100 gives twice the width as z = 100-150 (Also see -L).

-ccopies (more ...)
  Specify number of plot copies [Default is 1].

-p[x|y|z]azim/elev[/zlevel][+wlon0/lat0[/z0]][+vx0/y0] (more ...)
  Select perspective view. (Required -R and -J for proper functioning).

-t[transp] (more ...)
  Set PDF transparency level in percent.

-^
  Print a short message about the syntax of the command, then exits (NOTE: on Windows use just -).
+
  Print an extensive usage (help) message, including the explanation of any module-specific option (but not the GMT common options), then exits.
-?
  Print a complete usage (help) message, including the explanation of options, then exits.
--version
  Print GMT version and exit.
--show-datadir
  Print full path to GMT share directory and exit.

## Examples

To append a vertical color scale (7.5 cm long; 1.25 cm wide) to the right of a plot that is 6 inch wide and 4 inch high, using illumination, and show back- and foreground colors, and annotating every 5 units, use

>     gmt psscale -D6.5i/2i/7.5c/1.25c -O -Ccolors.cpt -I -E -B5:BATHYMETRY:/:m: > map.ps

## Notes

When the cpt file is discrete and no illumination is specified, the color bar will be painted using polygons. For all other cases we must paint with an image. Some color printers may give slightly different colors for the two methods given identical RGB values.

## See Also

gmt, makecpt, grd2cpt

### Navigation

- index
- next
- previous
- Project Home »
- GMT 5.1.1 documentation »
- PS »
- Search: