mbm_grdplot(1)

NAME
mbm_grdplot - Create an executable shellscript which will generate a GMT map of gridded data in a GMT grd file.

VERSION
Version 5.0

SYNOPSIS
mbm_grdplot -Ifile [-A[magnitude[/azimuth/elevation] -C[contour_control] -D[flipcolor/flipshade] -Gcolor_mode -H -Kintensity_file -Oroot -Ppagesize -S[color/shade] -T -Uorientation -V -W[color_style[/palette[ncolors]] | cptfile] ] Additional Options:
[-Btickinfo -Fcontour_file -Jprojection[/scale | width] -Ltitle[:scale_label] -Mmisc -Q -Rw/e/s/n -X -Y -Zmin/max[/mode] ] Miscellaneous Options:
[-MGDgmtdef/value -MGFscale_loc -MGL[f][x]lon0/lat0/slat/length[units][+llabel] -MGQdpi -MGSscalefactor -MGTx/y/size/angle/font/just/text -MGU[/dx/dy/][label] -MCAanot_int/[ffont_size][aangle][/r/g/b][o]] -MCGgap/width -MCQcut -MCT[+|-][gap/length][:LH] -MCWtype[pen] -MNA[nhgt[/P] | P] -MNFformat -MNIswathdata -MNN[ttick/tannot/dannot/tlen[/nhgt] | F | FP] -MNP[pingnumber_tick/pingnumber_annot/pingnumber_tick_len] -MTCfill -MTDresolution -MTGfill -MTIriver[/pen] -MTNborder[/pen] -MTSfill -MTWpen -MXGfill -MXIxy_file -MXM -MXSsymbol/size -MXWpen]

DESCRIPTION
mbm_grdplot is a macro that generates a shellscript of GMT commands which, when executed, will generate a Postscript plot of gridded data. Several styles of plots can be generated, including color fill maps, contour maps, color fill maps overlaid with contours, shaded relief color maps, slope magnitude maps, coastline maps, text labels, and xy data in lines or symbols. Five different color schemes are included. The plot will be scaled to fit on the specified page size or, if the scale is user defined, the page size will be chosen in accordance with the plot size. The primary purpose of this macro is to allow the simple, semi-automated production of nice looking maps with a few command line arguments. For users seeking more control over the plot appearance, a number of additional optional arguments are provided. Truly ambitious users may edit the plot shellscript to take advantage of GMT capabilities not supported by this macro. A companion macro mbm_grd3dplot can be used similarly to generate 3D perspective views of gridded data. The plot scripts generated by this macro will work with GMT version 5.0 and later, and are not compatible with earlier versions of GMT.

AUTHORSHIP
David W. Caress (caress@mbari.org)
  Monterey Bay Aquarium Research Institute
Dale N. Chayes (dale@ldeo.columbia.edu)
  Lamont-Doherty Earth Observatory

SIMPLE DESCRIPTION OF BASIC OPTIONS

-A  magnitude[/azimuth/elevation]
    Sets the parameters which control the synthetic illumination of the gridded data (shaded relief). The value magnitude is an effective vertical exageration which modulates the intensity of the shading; typical values are in the 0.1 to 10 range. The value azimuth is the azimuth in degrees from north from which the data is illuminated. The value elevation is the elevation of the illumination in degrees from horizontal. Defaults: magnitude = 0.2; azimuth = 0.0; elevation = 30.0;

-C  contour_control
    If -C is given alone, it causes unannotated contours to be drawn using a contour interval calculated from the data. The user may also use contour_control to specify the contour interval. See the COMPLETE DESCRIPTION OF OPTIONS section below for a more complete discussion.

-D  [flipcolor/flipshade]
    Normally, the color or grayscale tables used for color maps run from cool colors (or dark grays) for low grid values to hot colors (or light grays) for high grid values. This option reverses the color table so that cool colors (dark grays) correspond to high values and hot colors (light grays) to low values. If -D is given alone, it applies to the color table used for color or gray fill plots, shaded or unshaded. If the plot is to be shaded, either by synthetic illumination (-G2) or using an intensity file (-K and -G3 options), then setting flipshade = 1 will cause the shading convention to be reversed (e.g. high intensities overlaid as light shading). Using -D0/1 will flip the shading convention but leave the default color convention.

-G  color_mode
    Turns on color fill plot and sets the style of the plot.
            color_mode = 1: Color/gray fill.
            color_mode = 2: Color/gray fill shaded by
                            synthetic illumination.
            color_mode = 3: Color/gray fill shaded by
                            an intensity file. The -K
                            option must be used to specify
                 the intensity file.
            color_mode = 4: Color/gray fill of slope
                 magnitude.
            color_mode = 5: Color/gray fill shaded by
                            slope magnitude.

-H  This "help" flag cause the program to print out a description of its operation and then exit immediately.

-I  grdfile
    Sets the name of the gridded data file to be plotted. Alternatively, grdfile may be a list of grid files (one filename on each line) to be plotted together.

-K  intensity_file
    Sets the name of the gridded data file containing intensity values to be used for shading the map. Alternatively, grdfile may be a list of grid files (one filename on each line) to be used together. If a list of file is supplied, the intensity files must conform in order to the data grid files they will shade.

-O  root
    Sets the root used to construct the filename of the output shellscript (root.cmd) and names of files created when the shellscript is run. Normally the name of the input grid file or grid file list is used as the root.

-P  pagesize
    This option sets the size of the page the plot will be centered on. If the user does not set the plot scale, the plot will be sized as large as will fit on the designated page. If the user sets the plot scale such that the plot will not fit on the designated page, a larger page will be used. The supported page sizes include ANSI A, B, C, D, E, F, and E1, as well as most metric page sizes. See the COMPLETE DESCRIPTION OF OPTIONS section below for a complete list of the supported page sizes. The default page size is A.

-S  [color/shade]
    This option enables effective histogram equalization of the color and/or shading of the gridded data. The equalization is not achieved by changing the data values, but rather by constructing the color or shading tables so that the boundaries in the tables encompass equal fractions of the datapoints. This serves to focus color or shading contrasts in value ranges corresponding to the bulk of the data values. If -S is given alone or with color = 1, it enables equalization of the color table used for color or gray fill plots, shaded or unshaded. If the plot is to be shaded, either by synthetic illumination (-G2) or using an intensity file (-K and -G3 options), then setting shade = 1 will cause the shading to be equalized. Using -S0/1 will equalize the shading without equalizing the color table.

-T  If -T is given, it causes a coastline to be drawn on the map. The default is to draw the coastline as the thinnest possible line. To exercise greater control of the coastline plotting, including color fill of "dry" areas and display of lakes, rivers, and political boundaries, use the -MTC, -MTD, -MTG, -MTI, -MTN, -MTS, and -MTW options described in the COMPLETE DESCRIPTION OF OPTIONS section below.

-U  orientation
    Normally the orientation of the plot (portrait or landscape) is selected automatically so as to maximize the plot scale. The -U option allows the user to set the plot orientation. If orientation = 1, a portrait plot will be produced; if orientation = 2, a landscape plot will be produced.

-V  Causes mbm_grdplot to operate in "verbose" mode so that it outputs more information than usual.

-W  [color_style[/palette[ncolors]] | cptfile]
    This option controls the color scheme used for color fill plots. If color_style = 1 [default], then the color scheme used will be a continuous grading of colors. If color_style = 2, the color scheme will be a set of discrete color intervals. The color palette used is set using palette. Five palettes are available:
         palette = 1:    Haxby colors [default]
         palette = 2:    high Intensity colors
         palette = 3:    low Intensity colors
         palette = 4:    grayscale
         palette = 5:    uniform grayscale
    A complete description of the color palettes is given in the COMPLETE DESCRIPTION OF OPTIONS section below. The ncolors parameter sets the number of color values used in plotting, whether the colors are represented in a continuous color scale or a stepped, discrete color scale [default is 11]. If the option argument is the path to an existing GMT color palette (CPT) file, then that CPT file and its color scheme will be used for the plot

COMPLETE DESCRIPTION OF OPTIONS

-A  magnitude[/azimuth]
    Sets the parameters which control the synthetic illumination of the gridded data (shaded relief). The value magnitude is an effective vertical exageration which modulates the intensity of the shading; typical values are in the 0.1 to 0.5 range. The value azimuth is the azimuth from which the data is illuminated. Defaults: magnitude = 0.2; azimuth = 0.0;

-B  tickinfo
    Sets map boundary tickmark intervals. See the psbasemap manual page for details. By default the program chooses basemap annotations based on the map boundaries.

-C  contour_control
    If -C is given alone, it causes unannotated contours to be drawn using a contour interval calculated from the data. If contour_control is given, it specifies the contours to be drawn in one of three possible ways: If contour_control has the suffix ".cpt" and can be opened as a file, it is assumed to be a color palette table. The color boundaries are then used as contour levels. If the cpt-file has anotation flags in the last column then those contours will be anotated. By default no contours are labeled; use -MCA to anotate all contours. If contour_control is a file but not a cpt-file, it is expected to contain contour levels in column 1 and a C(ontour) OR A(nnotate) in col 2. The levels marked C (or c) are contoured, the levels marked A (or a) are contoured and annotated. Optionally, a third column may be present and contain the fixed anotation angle for this contour level. If no file is found, then contour_control is interpreted as a constant contour interval. If a file is given and -MCT is set, then only contours marked with upper case C or A will have tickmarks.

-D  [flipcolor/flipshade]
    Normally, the color or grayscale tables used for color maps run from cool colors (or dark grays) for low grid values to hot colors (or light grays) for high grid values. This option reverses the color table so that cool colors (dark grays) correspond to high values and hot colors (light grays) to low values. If -D is given alone, it applies to the color table used for color or gray fill plots, shaded or unshaded. If the plot is to be shaded, either by synthetic illumination (-G2) or using an intensity file (-K and -G3 options), then setting flipshade = 1 will cause the shading convention to be reversed (e.g. high intensities overlaid as light shading). Using -D0/1 will flip the shading convention but leave the default color convention.

-F  contour_file
    Sets the name of the file to use for generating contour lines. The default is to use the file being plotted, but in some situations, it can be useful to specify a separate file for contouring. For example, one might wish to overlay a backscatter mosaic with bathymetry contours, or a shaded bathymetry map with gravity anomaly contours.

-G  color_mode
    Turns on color fill plot and sets the style of the plot.
            color_mode = 1: Color/gray fill.
            color_mode = 2: Color/gray fill shaded by
                            synthetic illumination.
            color_mode = 3: Color/gray fill shaded by
                            an intensity file. The -K
                            option must be used to specify
                 the intensity file.
            color_mode = 4: Color/gray fill of slope
                 magnitude.
            color_mode = 5: Color/gray fill shaded by
                            slope magnitude.
    See the grdimage manual page for information on shading with intensity files

-H  This "help" flag cause the program to print out a description of its operation and then exit immediately.

-I  grdfile
    Sets the name of the gridded data file to be plotted. The data must be in a form acceptable to GMT version 3 programs (see the GMT Cookbook & Technical Reference). Alternatively, grdfile may be a list of grid files (one filename on each line) to be plotted together. This is useful when data from a region is broken up into several grid files rather than a single very large grid file.

-J  projection[/scale | /width]
    Selects the map projection. By default the map projection is Mercator and the plot scale is chosen to fit on the selected page size (see -P option). The user may specify a different projection to be used, in which case the plot scale is still automatically chosen to fit the page. The user may also specify both the projection and the plot scale. If the projection specifying character is upper case, a plot width rather than a plot scale is used. The scale values are specified in inch/degree or in 1:xxxxx ratios. Plot widths are specified in inches. If the user specifies a plot scale such that the plot will not fit on the default A size page, a appropriately larger page size will be chosen.

    CYLINDRICAL PROJECTIONS:

    -Jclon0/lat0/scale (Cassini)
    -Jmscale (Mercator)
    -Joalon0/lat0/azimuth/scale (Oblique Mercator - point and azimuth)
    -Joblon0/lat0/lon1/lat1/scale (Oblique Mercator - two points)
    -Joclon0/lat0/lonp/latp/scale (Oblique Mercator - point and pole)
    -Jqlon0/scale (Equidistant Cylindrical Projection (Plate Carree))
    -Jtlon0/scale (TM - Transverse Mercator)
    -Juzone/scale (UTM - Universal Transverse Mercator)
    -Jylon0/lats/scale (Basic Cylindrical Projection)

    AZIMUTHAL PROJECTIONS:

    -Jalon0/lat0/scale (Lambert).
    -Jelon0/lat0/scale (Equidistant).
    -Jglon0/lat0/scale (Orthographic).
    -Jslon0/lat0/scale (General Stereographic)

    CONIC PROJECTIONS:

    -Jblon0/lat0/lat1/lat2/scale (Albers)
    -Jllon0/lat0/lat1/lat2/scale (Lambert)

    MISCELLANEOUS PROJECTIONS:

    -Jhlon0/scale (Hammer)
    -Jilon0/scale (Sinusoidal)
    -Jklon0/scale (Eckert VI)
    -Jnlon0/scale (Robinson)
    -Jrlon0/scale (Winkel Tripel)
    -Jwlon0/scale (Mollweide)

    NON-GEOGRAPHICAL PROJECTIONS:

    -Jpscale (Linear projection for polar (theta,r) coordinates)
    -Jxx-scale[l|ppow][/y-scale[l|ppow]] (Linear, log, and power scaling)
    More details can be found in the psbasemap manpages.

-K  intensity_file
    Sets the name of the gridded data file containing intensity values to be used for shading the map. Alternatively, grdfile may be a list of grid files (one filename on each line) to be used together. If a list of files is supplied, the intensity files must conform in order to the list of data grid files they will shade.

-L  title:scalelabel
    Sets the title and the label for the colorscale (if used) of the plot. Note that a colon (:) rather than a slash (/) is used to separate the labels. Colons cannot be used in the labels themselves. If this option is not used, then a default title and colorscale label are provided. If the title is supplied alone, a default colorscale label will be provided. To force no title use -L" "; to force no title or colorscale label use -L" : ".

-M  A series of "miscellaneous" options are provided which are given as -M followed by a two character identifier, followed by any other parameters associated with that option. The -M options may be strung together separated by colons, e.g. "-MGQ100:GU:CA200/10", which is equivalent to "-MGQ -MGU -MCA200/10".

-MGD
    gmtdef/value
    Allows the user to set the GMT default values used as the plot is constructed. This command may be given repeatedly to set as many GMT defaults as required. For example, to set the basemap annotation font to Courier, use "-MGDANOT_FONT/Courier".

-MGF
    scale_loc
    Sets the location of the color scale. The possible values of scale_loc are:
         scale_loc = b:    bottom of plot
         scale_loc = t:    top of plot
         scale_loc = l:    left of plot
         scale_loc = r:    right of plot
    [Default scale_loc = b]

-MGL
    [f][x]lon0/lat0/slat/length[units][+llabel]
    Draws a simple map scale centered on lon0/lat0. Use -Lf to get a "fancy" scale [Default is plain]. Use -Lx to specify the position in inches instead of map units. The scale is calculated at latitude slat; if the string "center" is used instead of a numerical value for slat, then the macro will set the scaling according to the center of the plot bounds. The scale length value length is in km by default, but the units can be specified as one of e|f|k|M|n|u, where e = meters, f = feet, k = kilometers, M = statue miles, n = nautical miles, and u = US survey feet. Append +l to label the scale with the relevant units, or append +l"label" to set a different label string.

-MGQ
    dpi
    Sets the resolution in dots per inch of the raster image used for color fill maps. Larger values of dpi produce larger Postscript plot files. [Default is 100].

-MGS
    scalefactor
    The gridded data is multiplied by scalefactor. This option is most often used flip the sign of the data (scalefactor = -1). [Default no scaling]

-MGT
    x/y/size/angle/font/just/text
    Causes a text label to plotted on the map. size is text size in points, angle is measured in degrees counter-clockwise from horizontal, fontno sets the font type, justify sets the alignment. If fontno starts with a leading hyphen, then the remainder of fontno is taken to be a textstring with the desired fontname. See the gmtdefaults man page for names and numbers of available fonts (or run pstext -L). The alignment number refers to the part of the textstring that will be mapped onto the (x,y) point: 1 = Lower Left corner, 2 = Lower Center, 3 = Lower Right, 5 = Mid Left, 6 = Mid Center, 7 = Mid Right, 9 = Upper Left, 10 = Upper Center, 11 = Upper Right. This option may be given as many times as needed.

-MGU
    [/dx/dy/][label]
    Draw Unix System time stamp on plot. User may specify where the lower left corner of the stamp should fall on the page relative to lower left corner of plot in inch [Default is (-0.75,-0.75)]. Optionally, append a label, or c (which will plot the command string.)

-MCA
    anot_int/[ffont_size][aangle][/r/g/b][o]]
    anot_int is annotation interval in data units. Ignored if contour levels are given in a file. [Default is no annotations]. Several options can be set to modify the form of the annotation. Append ffont_size to change font size [9], append /r/g/b to change color of text fill box [PAGE_COLOR], append aangle to fix annotation angle [Default follows contour], and append 'o' to draw the outline of the surrounding text box [Default is no outline].

-MCG
    gap/width -MCQcut
    gap is distance in inch between each annotation along the same contour. width is number of points over which to estimate the best fitting slope for contour labels [Default is 4/10].

-MCQ
    cut
    Do not draw contours with less than cut number of points [Draw all contours].

-MCT
    [+|-][gap/length][:LH]
    Will draw tickmarks pointing in the downward direction every gap along the innermost closed contours. Append gap and tickmark length (in inch) or use defaults [0.2/0.05]. User may choose to tick only local highs or local lows by specifying -T+ or -T-, respectively. Appending :LH will plot the characters L and H at the center of closed innermost contours (local lows and highs). L and H can be any single character (e.g., LH, -+, etc.) If a file is given by -C and -T is set, then only contours marked with upper case C or A will have tickmarks [and anotation].

-MCW
    type[pen]
    type, if present, can be 'a' for annotated contours or 'c' for regular contours [Default]. pen sets the attributes for the particular line. Default values for annotated contours: width = 3, color = black, texture = solid. Regular contours have default width = 1.

-MNA
    [nhgt[/P] | P]
    Turns on filename annotation of navigation tracks. If -MNA is given without specifying any controlling parameters, then the lettering height nhgt is 0.15 and the filenames are plotted parallel to the navigation track from the start of the track. The lettering height can be specified using either -MNAnhgt or -MNAnhgt/P. If -MNAP or -MNAnhgt/P is specified, the filename will be plotted perpendicular to the navigation track. Filename annotation can also be specified using the -N option. Defaults: Filename annotation off.

-MNF
    format
    Sets the data format for the input swath data specified with the -MNI option. If format < 0, then the input file specified with the -MNI option will actually contain a list of input swath sonar data files. This program uses the MBIO library and will read or write any swath sonar format supported by MBIO. A list of the swath sonar data formats currently supported by MBIO and their identifier values is given in the MBIO manual page. Default: format = -1.

-MNI
    swathdata
    This option causes the navigation track of swath data to be plotted. Here swathdata is the input file, and may be either a single swath file or a list of swath files. If format > 0 (set with the -MNF option) then the swath sonar data contained in swathdata is read and processed. If format < 0 (the default), then swathdata is assumed to be an ascii file containing a list of the input swath sonar data files to be processed and their formats. The program will read the data in each one of these files. In the swathdata file, each data file should be followed by a data format identifier, e.g.:
         datafile1 11
         datafile2 24
    This program uses the MBIO library and will read or write any swath sonar format supported by MBIO. A list of the swath sonar data formats currently supported by MBIO and their identifier values is given in the MBIO manual page.

-MNN
    [ttick/tannot/dannot/tlen[/nhgt/nperp] | F | FP]
    This option sets the annotation of the swath file navigation plot specified using the -MNI option. Time marks are made with "X" marks along the shiptrack; annotated time marks show the time in HH:MM format next to the time mark and annotated date marks show the time and julian day in HH:MM/DDD format. The "X" marks are tlen inches high for normal time marks and 1.5 times tlen inches high for annotated time or date marks. The interval of time ticks, annotated time ticks, and annotated date ticks are given in hours by ttick, tannot, and dannot, respectively. If the nhgt parameter is not given when the other parameters are specified, then no filename annotation will be done. If given, nhgt sets the height in inches of the filename annotation and turns that annotation on. If given as 1, nperp causes the filename annotation to be perpendicular to the shiptrack rather than parallel (the default). If the -MNNF is given, then a navigation track will be generated using the default parameters and also with filename annotation along the shiptrack. If the -MNNFP is given, then a navigation track will be generated with the default parameters and also with filename annotation perpendicular to the shiptrack. Defaults: ttick = 0.25; tannot = 1.0; dannot = 4.0; tlen = 0.1; nhgt = 0.1; nperp = 0.

-MNP
    [pingnumber_tick/pingnumber_annot/pingnumber_tick_len]
    Turns on ping number (or shot number) annotation of navigation tracks. Tick marks are made along the shiptrack at pingnumber_tick intervals; these are tlen inches long. Longer tick marks are made along the shiptrack at pingnumber_annot intervals; these are 1.5 times tlen inches long. Defaults: Pingnumber annotation off. If the -MNP option is given without specifying the controlling parameters, then pingnumber_tick = 50, pingnumber_annot = 100, and pingnumber_tick_len = 0.1.

-MTC
    fill
    Coastline plotting option. Set the shade (0-255), color (r/g/b), or pattern (p|Pdpi/pattern; see -MTG) for lakes [Default is the fill chosen for "wet" areas (-S)].

-MTD
    resolution
    Coastline plotting option. Selects the resolution of the coastline data set to use ((f)ull, (h)igh, (i)ntermediate, (1)ow, and (c)rude). The resolution drops off by 80% between data sets. [Default is l].

-MTG
    fill
    Coastline plotting option. Select painting or clipping of "dry" areas. Append a shade, color, pattern, or c for clipping. Specify the shade (0-255) or color (r/g/b), or -MTGpdpi/pattern, where pattern gives the number of the built-in pattern (1-90) OR the name of a Sun 1-, 8-, or 24-bit raster file. dpi sets the resolution of the image. See GMT Cookbook & Technical Reference Appendix E for information on individual patterns.

-MTI
    river[/pen]
    Coastline plotting option. Draw rivers. Specify the type of rivers and [optionally] append pen attributes [Default pen: width = 1, color = 0/0/0, texture = solid]. Choose from the list of river types below. Repeat option -I as often as necessary.
         1 = Permanent major rivers
         2 = Additional major rivers
         3 = Additional rivers
         4 = Minor rivers
         5 = Intermittent rivers - major
         6 = Intermittent rivers - additional
         7 = Intermittent rivers - minor
         8 = Major canals
         9 = Minor canals
         10 = Irrigation canals
         a = All rivers and canals (1-10)
         r = All permanent rivers (1-4)
         i = All intermittent rivers (5-7)
         c = All canals (8-10)

-MTN
    border[/pen]
    Coastline plotting option. Draw political boundaries. Specify the type of boundary and [optionally] append pen attributes [Default pen: width = 1, color = 0/0/0, texture = solid]. Choose from the list of boundaries below. Repeat option -MTN as often as necessary.
         1 = National boundaries
         2 = State boundaries within the Americas
         3 = Marine boundaries
         a = All boundaries (1-3)

-MTS
    fill
    Coastline plotting option. Select painting or clipping of "wet" areas. Append the shade (0-255), color (r/g/b), pattern (see -MTG), or c for clipping.

-MTW
    pen
    Coastline plotting option. Append pen attributes [Defaults: width = 1, color = 0/0/0, texture = solid].

-MXG
    fill
    Select filling of symbols for xy plotting. Set the shade (0-255) or color (r/g/b) [Default is no fill]. To reset no fill, use fill = "N". For polygons, you may optionally specify -Gpicon_size/pattern, where pattern gives the number of the image pattern (1-32) OR the name of a icon-format file. icon_size sets the unit size in inch. To invert black and white pixels, use -GP instead of -Gp. See GMTs Cookbook & Technical Reference Appendix E for information on individual patterns.

-MXI
    xy_file
    Specifies a file containing (x,y) pairs to be plotted as lines or symbols. The line and symbol characteristics are set using the last -MXG, -MXS, and -MXW options used. All of the -MX commands can be given multiple times, so by stringing series of these commands together the user can plot different files using different line or symbol characteristics. [Default is a solid black line].

-MXM
    Toggles expectation for xy data files having multiple segments, in which each segment is to be plotted separately. Segments are separated by a record whose first character is '>'. By default, unsegmented files are expected. Users may give this command multiple times, allowing some input files to be handled as segmented and others not.

-MXS
    symbol/size
    Selects symbol to be used for plotting the next xy data file. Setting symbol = "N" causes line plotting. Choose between:

-MXSa
    star. size is radius of circumscribing circle.

-MXSb
    bar extending from base to y. size is bar width. By default, base = 0. Append /base to change this value. Append u if size is in x-units [Default is inch].

-MXSc
    circle. size is diameter of circle.

-MXSd
    diamond. size is side of diamond.

-MXSe
    ellipse. Direction (in degrees counterclockwise from horizontal), major_axis (in inch), and minor_axis (in inch) must be found in columns 3, 4, and 5.

-MXSf
    fault. Give distance gap between ticks and ticklength in inch. If gap is negative, it is interpreted to mean number of ticks instead. Append l or r to draw tick on the left or right side of line [Default is centered]. Upper case L or R draws a triangle instead of line segment.

-MXSh
    hexagon. Give side in inch.

-MXSi
    inverted triangle. Give side in inch.

-MXSl
    letter or text string. Give size in inch, and append /string after the size. Note that the size is only approximate; no individual scaling is done for different characters. Remember to escape special characters like *.

-MXSp
    point. No size needs to be specified (1 pixel is used).

-MXSs
    square. Give side in inch.

-MXSt
    triangle. Give side in inch.

-MXSv
    vector. Direction (in degrees counterclockwise from horizontal) and length (in inch) must be found in columns 3 and 4. size, if present, will be interpreted as arrowwidth/headlength/headwidth (in inch) [Default is 0.03/0.12/0.1 inch]. By default arrow attributes remains invariant to the length of the arrow. To have the size of the vector scale down with decreasing size, append nnorm, where vectors shorter than norm will have their attributes scaled by length/norm.

-MXSV
    Same as -MXSv, except azimuth (in degrees east of north) should be given instead of direction. The azimuth will be mapped into an angle based on the chosen map projection (-MXSv leaves the directions unchanged.)

-MXSx
    cross. Give length in inch.

-MXW
    pen
    Set pen attributes for xy plotting. See chapter 4.12 in the GMT Technical reference for a discussion of GMT pen values. [Defaults: width = 1, color = 0/0/0, texture = solid].

-O  root
    Sets the root used to construct the filename of the output shellscript (root.cmd) and names of files created when the shellscript is run. Normally the name of the input grid file or grid file list is used as the root.

-P  pagesize
    This option sets the size of the page the plot will be centered on. If the user does not set the plot scale, the plot will be sized as large as will fit on the designated page. If the user sets the plot scale such that the plot will not fit on the designated page, a larger page will be used. The supported page sizes are:
              American ANSI sizes:
              A 8.5 x 11.0 in. ( 215.9 x 279.4 mm)
              B 11.0 x 17.0 in. ( 279.4 x 431.8 mm)
              C 17.0 x 22.0 in. ( 431.8 x 558.8 mm)
              D 22.0 x 34.0 in. ( 558.8 x 863.6 mm)
              E 34.0 x 44.0 in. ( 863.6 x 1117.6 mm)
              F 28.0 x 40.0 in. ( 711.2 x 1016.0 mm)
              E1 44.0 x 68.0 in. (1117.6 x 1727.2 mm)
              Metric ISO A sizes:
              A0 841.0 x 1189.0 mm (33.11 x 46.81 in.)
              A1 594.0 x 841.0 mm (23.39 x 33.11 in.)
              A2 420.0 x 594.0 mm (16.54 x 23.39 in.)
              A3 297.0 x 420.0 mm (11.69 x 16.54 in.)
              A4 210.0 x 297.0 mm ( 8.27 x 11.69 in.)
              A5 148.0 x 210.0 mm ( 5.83 x 8.27 in.)
              A6 105.0 x 148.0 mm ( 4.13 x 5.83 in.)
              A7 74.0 x 105.0 mm ( 2.91 x 4.13 in.)
              A8 52.0 x 74.0 mm ( 2.05 x 2.91 in.)
              A9 37.0 x 52.0 mm ( 1.46 x 2.05 in.)
              A10 26.0 x 37.0 mm ( 1.02 x 1.46 in.)
              Metric ISO B sizes:
              B0 1000.0x 1414.0 mm (39.37 x 55.67 in.)
              B1 707.0 x 1000.0 mm (27.83 x 39.37 in.)
              B2 500.0 x 707.0 mm (19.68 x 27.83 in.)
              B3 353.0 x 500.0 mm (13.90 x 19.68 in.)
              B4 250.0 x 353.0 mm ( 9.84 x 13.90 in.)
              B5 176.0 x 250.0 mm ( 6.93 x 9.84 in.)
              B6 125.0 x 176.0 mm ( 4.92 x 6.93 in.)
              B7 88.0 x 125.0 mm ( 3.46 x 4.92 in.)
              B8 62.0 x 88.0 mm ( 2.44 x 3.46 in.)
              B9 44.0 x 62.0 mm ( 1.73 x 2.44 in.)
              B10 31.0 x 44.0 mm ( 1.22 x 1.73 in.)
              Metric ISO C sizes:
              C0 914.4 x 1300.5 mm (36.00 x 51.20 in.)
              C1 650.2 x 914.4 mm (25.60 x 36.00 in.)
              C2 457.2 x 650.2 mm (18.00 x 25.60 in.)
              C3 325.1 x 457.2 mm (12.80 x 18.00 in.)
              C4 228.6 x 325.1 mm ( 9.00 x 12.80 in.)
              C5 162.6 x 228.6 mm ( 6.40 x 9.00 in.)
              C6 114.3 x 162.6 mm ( 4.50 x 6.40 in.)
              C7 81.3 x 114.3 mm ( 3.20 x 4.50 in.)
          MB-System large format sizes:
              m1 1371.6 x 1828.8 mm (54.00 x 72.00 in.)
              m2 1371.6 x 2133.6 mm (54.00 x 84.00 in.)
              m3 1371.6 x 2438.4 mm (54.00 x 96.00 in.)
              m4 1524.0 x 1828.8 mm (60.00 x 72.00 in.)
              m5 1524.0 x 2133.6 mm (60.00 x 84.00 in.)
              m6 1524.0 x 2438.4 mm (60.00 x 96.00 in.) The default page size is A.

-Q  Normally, the output plot generation shellscript includes lines which execute a program to display the Postscript image on the screen. This option causes those lines to be commented out so that executing the shellscript produces a Postscript plot but does not attempt to display it on the screen. The program to be used to display the Postscript is set using mbdefaults; the default value can be overridden by setting the environment variable $MB_PS_VIEWER.

-R  west/east/south/north
    west, east, south, and north specify the Region of interest. To specify boundaries in degrees and minutes [and seconds], use the dd:mm[:ss] format. Append r if lower left and upper right map coordinates are given instead of wesn. You may ask for a larger w/e/s/n region to have more room between the image and the axes. A smaller region than specified in the grdfile will result in a subset of the grid [Default is region given by the grdfile].

-S  [color/shade]
    This option enables effective histogram equalization of the color and/or shading of the gridded data. The equalization is not achieved by changing the data values, but rather by constructing the color or shading tables so that the boundaries in the tables encompass equal fractions of the datapoints. This serves to focus color or shading contrasts in value ranges corresponding to the bulk of the data values. If -S is given alone or with color = 1, it enables equalization of the color table used for color or gray fill plots, shaded or unshaded. If the plot is to be shaded, either by synthetic illumination (-G2) or using an intensity file (-K and -G3 options), then setting shade = 1 will cause the shading to be equalized. Using -S0/1 will equalize the shading without equalizing the color table.

-T  If -T is given, it causes a coastline to be drawn on the map. The default is to draw the coastline as the thinnest possible line. To exercise greater control of the coastline plotting, including color fill of "dry" areas and display of lakes, rivers, and political boundaries, use the -MTC, -MTD, -MTG, -MTI, -MTN, -MTS, and -MTW options.

-U  orientation
    Normally the orientation of the plot (portrait or landscape) is selected automatically so as to maximize the plot scale. The -U option allows the user to set the plot orientation. If orientation = 1, a portrait plot will be produced; if orientation = 2, a landscape plot will be produced.

-V  Causes mbm_grdplot to operate in "verbose" mode so that it outputs more information than usual.

-W  [color_style[/palette[ncolors]] | cptfile]
    This option controls the color scheme used for color fill plots. If color_style = 1 [default], then the color scheme used will be a continuous grading of colors. If color_style = 2, the color scheme will be a set of discrete color intervals. The color palette used is set using palette. Seven palettes are available:
         palette = 1:    Haxby colors [default]
         palette = 2:    high Intensity colors
         palette = 3:    low Intensity colors
         palette = 4:    grayscale
         palette = 5:    uniform grayscale
         palette = 6:    uniform black
         palette = 7:    uniform white
         palette = 8:    sealevel 1
         palette = 9:    sealevel 2
    The RGB definitions of the color palettes are: color palette 1 - Haxby Color Table
      red: 255 255 255 255 240 205 138 106 50 40 37
      green: 255 186 161 189 236 255 236 235 190 127 57
      blue: 255 133 68 87 121 162 174 255 255 251 175 color palette 2 - High Intensity Colors
      red: 255 255 255 255 128 0 0 0 0 128 255
      green: 0 64 128 255 255 255 255 128 0 0 0
      blue: 0 0 0 0 0 0 255 255 255 255 255 color palette 3 - Low Intensity Colors
      red: 200 194 179 141 90 0 0 0 0 90 141
      green: 0 49 90 141 179 200 141 90 0 0 0
      blue: 0 0 0 0 0 0 141 179 200 179 141 color palette 4 - Grayscale
      red: 255 230 204 179 153 128 102 77 51 26 0
      green: 255 230 204 179 153 128 102 77 51 26 0
      blue: 255 230 204 179 153 128 102 77 51 26 0 color palette 5 - Uniform Grayscale
      red: 128 128 128 128 128 128 128 128 128 128 128
      green: 128 128 128 128 128 128 128 128 128 128 128
      blue: 128 128 128 128 128 128 128 128 128 128 128 color palette 6 - Uniform Black
      red: 0 0 0 0 0 0 0 0 0 0 0
      green: 0 0 0 0 0 0 0 0 0 0 0
      blue: 0 0 0 0 0 0 0 0 0 0 0 color palette 7 - Uniform White
      red: 255 255 255 255 255 255 255 255 255 255 255
      green: 255 255 255 255 255 255 255 255 255 255 255
      blue: 255 255 255 255 255 255 255 255 255 255 255 color pallette 8 - Sealevel 1
      (colors here used above zero Haxby colors below)
      red: 250 245 240 235 230 221 212 211 210 205 200
      green: 250 240 230 221 212 201 190 180 170 160 150
      blue: 120 112 104 96 88 80 72 64 56 48 40 color pallette 9 - Sealevel 2
      (colors here used above zero Haxby colors below)
      red: 255 210 170 145 120 120 104 67 33 0 0
      green: 255 200 160 145 130 100 107 123 140 160 230
      blue: 100 75 50 45 40 30 24 7 0 0 0 The Haxby colors have been adapted from a palette developed by Dr. William Haxby of the Lamont-Doherty Earth Observatory; this palette is pleasing to the eye and well suited for shading. The high intensity colors describe linear paths through RGB space from red to blue to green to purple; because the colors are high intensity they are not well suited to shading. The low intensity colors are similar to the high intensity, but muted and thus well suited to shading. The grayscale palette runs linearly from white to black and is commonly used for plots of sidescan and amplitude data. The uniform grayscale is useful for non-color shaded relief plots. The ncolors parameter sets the number of color values used in plotting, whether the colors are represented in a continuous color scale or a stepped, discrete color scale [default is 11]. If the option argument is the path to an existing GMT color palette (CPT) file, then that CPT file and its color scheme will be used for the plot

-X  Normally, mbm_grdplot creates an executable shellscript and then exits. This option will cause the shellscript to be executed in the background before mbm_grdplot exits.

-Y  Normally, mbm_grdplot generates nicely rounded numbers for the boundaries of the color palette. Often, the resulting color bounds extend well outside the range of the gridded data. This option causes the minimum and maximum color boundaries to exactly conform to the minimum and maximum values of the grid, or, if the -Z option is used, the minimum and maximum values specified by the user.

-Z  min/max[/mode]
    This option overrides the minimum and maximum values of the gridded data, affecting the color palette and the contour interval if those parameters are not specified by the user. By default (i.e. mode is omitted or equal to 0), the macro selects the color palette bounds so that they encompass min and max while using nicely rounded numbers. If mode is omitted or equal to 0, then the color palette will end near min and max whether it is linear stretched or histogram equalized. If mode = 1, then the color stretching calculations will be done using min and max, but then the first and last values in the color palette will be set to the actual minimum and maximum values.so that all the data are displayed.

EXAMPLES
Suppose we have obtained two GRD files with dimensions of 127 by 194, one containing gridded bathymetry (grd_sb2112_example_bath) and the other gridded sidescan (grd_sb2112_example_ss). In order to generate a shellscript which will in turn generate a contour plot of the bathymetry, the following will suffice:
      mbm_grdplot -Igrd_sb2112_example_bath -C \
          -V -Ogrd_sb2112_example_bathcont In order to generate a color fill plot overlaid by contours, we use both the -G1 and -C options. Because the data has been gridded as bathymetry (positive down) rather than as topography (positive up), the default plot will have "hot" colors for deep regions and "cold" colors for shallow regions; this is the opposite of the convention we usually use. In order to fix the colors, we have to either rescale the data by multiplying the bathymetry by -1 (accomplished with -MGS-1), or flip the color palette (accomplished with -D). We use the latter approach:
      mbm_grdplot -Igrd_sb2112_example_bath -G1 -C -D \
          -V -Ogrd_sb2112_example_bathfill In order to generate a grayscale plot of the sidescan grid, we use -G1 and -W1/4. We also use -D so that high sidescan amplitudes are shown as dark.
      mbm_grdplot -Igrd_sb2112_example_ss -G1 -D \
          -V -Ogrd_sb2112_example_ssfill Now consider generating a shaded relief view of the gridded bathymetry. We choose to illuminate the bathymetry from the northeast (azimuth of 45 degrees) and to use a shading magnitude of 0.4 (-A0.4/45). Because this grid is so small, the default shaded relief image is likely to be grainy. To fix this problem, we specify a dots per inch resolution of 72 (-MGQ72); this will take longer and generate a larger plotfile, but the plot will look better. We also use the -L option to specify the title and color scale label for the plot. We also use the -X flag this so that the plot generation shellscript is executed immediately. Here is the command:
      mbm_grdplot -Igrd_sb2112_example_bath \
          -G2 -A0.4/45 -D -MGQ72 -X -V \
          -L"Shaded Relief Bathymetry":"Depth (meters)" \
          -Osb2112_example_bathshade Now, consider generating a plot of the bathymetry overlaid with the gridded sidescan. The sidescan overlay is specified using the -K option. We want the colors for the bathymetry to be chosen without histogram equalization, but we also want histogram equalization to be applied to the sidescan data used for shading. To do this, we use -S0/1, where the first number (0) specifies no histogram equalization of the color scale and the second number (1) causes histogram equalization of the shading sidescan data to be implemented. In order to maintain the convention that high sidescan amplitudes are black, we flip both the color palette (as in the previous example) and the shading scale with -D1/1. We could also flip the shading by specifying a negative shading magnitude (-A-0.4). In this case, we forgo specifying the image resolution, resulting in a grainy plot:
      mbm_grdplot -Igrd_sb2112_example_bath \
          -G3 -Kgrd_sb2112_example_ss \
          -S0/1 -D1/1 -A0.4 -X -V \
          -L"Bathymetry Overlaid With Sidescan":"Depth (meters)" \
          -Osb2112_example_bathss As an example, the contents of the plotting shellscript "grd_sb2112_example_bathfill.cmd" are:
 #
 # Shellscript to create Postscript plot of data in grd file
 # Created by macro mbm_grdplot
 #
 # This shellscript created by following command line:
 # mbm_grdplot -Igrd_sb2112_example_bath -G1 -C -D \
 #    -V -Ogrd_sb2112_example_bathfill
 #
 # Save existing GMT defaults
 echo Saving GMT defaults...
 gmtdefaults -L > gmtdefaults$$
 #
 # Set new GMT defaults
 echo Setting new GMT defaults...
 gmtset ANOT_FONT Helvetica
 gmtset LABEL_FONT Helvetica
 gmtset HEADER_FONT Helvetica
 gmtset ANOT_FONT_SIZE 8
 gmtset LABEL_FONT_SIZE 8
 gmtset HEADER_FONT_SIZE 10
 gmtset FRAME_WIDTH 0.074999999999999997
 gmtset TICK_LENGTH 0.074999999999999997
 gmtset PAGE_ORIENTATION LANDSCAPE
 gmtset COLOR_BACKGROUND 0/0/0
 gmtset COLOR_FOREGROUND 255/255/255
 gmtset COLOR_NAN 255/255/255
 #
 # Make color palette table file
 echo Making color palette table file...
 echo 3000 255 255 255 3150 255 186 133 > \
        grd_sb2112_example_bathfill.cpt
 echo 3150 255 186 133 3300 255 161 68 >> \
        grd_sb2112_example_bathfill.cpt
 echo 3300 255 161 68 3450 255 189 87 >> \
        grd_sb2112_example_bathfill.cpt
 echo 3450 255 189 87 3600 240 236 121 >> \
        grd_sb2112_example_bathfill.cpt
 echo 3600 240 236 121 3750 205 255 162 >> \
        grd_sb2112_example_bathfill.cpt
 echo 3750 205 255 162 3900 138 236 174 >> \
        grd_sb2112_example_bathfill.cpt
 echo 3900 138 236 174 4050 106 235 255 >> \
        grd_sb2112_example_bathfill.cpt
 echo 4050 106 235 255 4200 50 190 255 >> \
        grd_sb2112_example_bathfill.cpt
 echo 4200 50 190 255 4350 40 127 251 >> \
        grd_sb2112_example_bathfill.cpt
 echo 4350 40 127 251 4500 37 57 175 >> \
        grd_sb2112_example_bathfill.cpt
 #
 # Make color image
 echo Running grdimage...
 grdimage grd_sb2112_example_bath -Jm24.418434289993325 \
        -R114.221/114.421/-31.9001/-31.6377 \
        -Cgrd_sb2112_example_bathfill.cpt \
        -P -X1.8081565710006675 -Y2 -K -V \
        > grd_sb2112_example_bathfill.ps
 #
 # Make contour plot
 echo Running grdcontour...
 grdcontour grd_sb2112_example_bath -Jm24.418434289993325 \
        -R114.221/114.421/-31.9001/-31.6377 \
        -C50 \
        -L3144.51/4499.44 -Wc1p \
        -P -K -O -V >> grd_sb2112_example_bathfill.ps
 #
 # Make color scale
 echo Running psscale...
 psscale -Cgrd_sb2112_example_bathfill.cpt \
        -D2.4418/-0.5000/4.8837/0.1500h \
        -B":.Data Values:" \
        -P -K -O -V >> grd_sb2112_example_bathfill.ps
 #
 # Make basemap
 echo Running psbasemap...
 psbasemap -Jm24.418434289993325 \
        -R114.221/114.421/-31.9001/-31.6377 \
        -B5m/5m:."Data File grd_sb2112_example_bath": \
        -P -O -V >> grd_sb2112_example_bathfill.ps
 #
 # Delete surplus files
 echo Deleting surplus files...
 rm -f grd_sb2112_example_bathfill.cpt
 #
 # Reset GMT default fonts
 echo Resetting GMT fonts...
 mv gmtdefaults$$ .gmtdefaults
 #
 # Run xpsview
 echo Running xpsview in background...
 xpsview -ps a -maxp 4m grd_sb2112_example_bathfill.ps &
 #
 # All done!
 echo All done!

SEE ALSO
grdimage(1), grdcontour(1), mbdefaults(1), mbgrid(1), mbsystem(1), mbm_grd3dplot(1), mbm_plot(1), psbasemap(1), pstext(1), psxy(1)

BUGS
By making this macro more useful, we have also made it more complex.