psxyz − Plot lines, polygons, and symbols in 3-D


psxyz files −Jparameters −Jz|Zparameters −Rwest/east/south/north[/zmin/zmax][r] [ −B[p|s]parameters ] [ −Ccptfile ] [ −Ddx/dy[dz] ] [ −Eazim/elev[+wlon/lat[/z]][+vx0/y0] ] [ −Gfill ] [ −H[i][nrec] ] [ −Iintens ] [ −K ] [ −L ] [ −N ] [ −O ] [ −P ] [ −Q ] [ −S[symbol][size] ] [ −U[just/dx/dy/][c|label] ] [ −V ] [ −W[-|+][pen] ] [ −X[a|c|r][x-shift[u]] ] [ −Y[a|c|r][y-shift[u]] ] [ −Zzlevel ] [ −:[i|o] ] [ −bi[s|S|d|D[ncol]|c[var1/...]] ] [ −ccopies ] [ −fcolinfo ] [ −g[a]x|y|d|X|Y|D|[col]z[+|-]gap[u] ] [ −m[flag] ]


psxyz reads (x,y,z) triplets from files [or standard input] and generates PostScript code that will plot lines, polygons, or symbols at those locations in 3-D. If a symbol is selected and no symbol size given, then psxyz will interpret the fourth column of the input data as symbol size. Symbols whose size is <= 0 are skipped. If no symbols are specified then the symbol code (see −S below) must be present as last column in the input. Multiple segment files may be plotted using the −m option. If −S is not used, a line connecting the data points will be drawn instead. To explicitly close polygons, use −L. Select a fill with −G. If −G is set, −W will control whether the polygon outline is drawn or not. If a symbol is selected, −G and −W determines the fill and outline/no outline, respectively. The PostScript code is written to standard output.


List one or more file-names. If no files are given, psxyz will read standard input.


Selects the map projection. Scale is UNIT/degree, 1:xxxxx, or width in UNIT (upper case modifier). UNIT is cm, inch, or m, depending on the MEASURE_UNIT setting in .gmtdefaults4, but this can be overridden on the command line by appending c, i, or m to the scale/width value. When central meridian is optional, default is center of longitude range on −R option. Default standard parallel is the equator. For map height, max dimension, or min dimension, append h, +, or - to the width, respectively.

More details can be found in the psbasemap man pages.


−Jclon0/lat0/scale (Cassini)
/[lon0/[lat0/]]scale (Cylindrical Stereographic)
[lon0/]scale (Miller)
[lon0/[lat0/]]scale (Mercator)
lon0/lat0/scale (Mercator - Give meridian and standard parallel)
[a]lon0/lat0/azimuth/scale (Oblique Mercator - point and azimuth)
[b]lon0/lat0/lon1/lat1/scale (Oblique Mercator - two points)
lon0/lat0/lonp/latp/scale (Oblique Mercator - point and pole)
[lon0/[lat0/]]scale (Cylindrical Equidistant)
lon0/[lat0/]scale (TM - Transverse Mercator)
zone/scale (UTM - Universal Transverse Mercator)
[lon0/[lat0/]]scale (Cylindrical Equal-Area)


−Jblon0/lat0/lat1/lat2/scale (Albers)
lon0/lat0/lat1/lat2/scale (Conic Equidistant)
lon0/lat0/lat1/lat2/scale (Lambert Conic Conformal)
/[lon0/[lat0/]]scale ((American) Polyconic)


−Jalon0/lat0[/horizon]/scale (Lambert Azimuthal Equal-Area)
lon0/lat0[/horizon]/scale (Azimuthal Equidistant)
lon0/lat0[/horizon]/scale (Gnomonic)
lon0/lat0[/horizon]/scale (Orthographic)
lon0/lat0/altitude/azimuth/tilt/twist/Width/Height/scale (General Perspective).
lon0/lat0[/horizon]/scale (General Stereographic)


−Jh[lon0/]scale (Hammer)
[lon0/]scale (Sinusoidal)
[lon0/]scale (Eckert IV)
[s][lon0/]scale (Eckert VI)
[lon0/]scale (Robinson)
[lon0/]scale (Winkel Tripel)
[lon0/]scale (Van der Grinten)
[lon0/]scale (Mollweide)


−Jp[a]scale[/origin][r|z] (Polar coordinates (theta,r))
x-scale[d|l|ppow|t|T][/y-scale[d|l|ppow|t|T]] (Linear, log, and power scaling)


Sets the vertical scaling (for 3-D maps). Same syntax as −Jx.


xmin, xmax, ymin, and ymax specify the Region of interest. For geographic regions, these limits correspond to west, east, south, and north and you may specify them in decimal degrees or in [+-]dd:mm[][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. For calendar time coordinates you may either give (a) relative time (relative to the selected TIME_EPOCH and in the selected TIME_UNIT; append t to −JX|x), or (b) absolute time of the form [date]T[clock] (append T to −JX|x). At least one of date and clock must be present; the T is always required. The date string must be of the form [-]yyyy[-mm[-dd]] (Gregorian calendar) or yyyy[-Www[-d]] (ISO week calendar), while the clock string must be of the form hh:mm:ss[.xxx]. The use of delimiters and their type and positions must be exactly as indicated (however, input, output and plot formats are customizable; see gmtdefaults).


No space between the option flag and the associated arguments.


Sets map boundary annotation and tickmark intervals; see the psbasemap man page for all the details.


Give a color palette file. If −S is set, let symbol fill color be determined by the t-value in the fourth column. Additional fields are shifted over by one column (optional size would be in 5th rather than 4th field, etc.). If −S is not set, then psxyz expects the user to supply a multisegment line or polygon file (requires −m) where each segment header contains a −Zval string. The val will control the color of the line or polygon (if −L is set) via the cpt file.


Offset the plot symbol or line locations by the given amounts dx/dy[dz] [Default is no offset].


Sets the viewpoint’s azimuth and elevation (for perspective view) [180/90]. For frames used for animation, you may want to append + to fix the center of your data domain (or specify a particular world coordinate point with +wlon0/lat[/z]) which will project to the center of your page size (or specify the coordinates of the projected view point with +vx0/y0).


Select color or pattern for filling of symbols or polygons [Default is no fill]. (See SPECIFYING FILL below).

Note when −m is chosen, psxyz will search for −G and −W strings in all the subheaders and let any values thus found over-ride the command line settings (see −m below).


Input file(s) has header record(s). If used, the default number of header records is N_HEADER_RECS. Use −Hi if only input data should have header records [Default will write out header records if the input data have them]. Blank lines and lines starting with # are always skipped.


Use the supplied intens value (nominally in the -1 to + 1 range) to modulate the fill color by simulating illumination [none].


More PostScript code will be appended later [Default terminates the plot system].


Force closed polygons: connect the endpoints of the line-segment(s) and draw polygons. Also, in concert with −C, −m, and −Z settings in the headers will use the implied color for polygon fill [Default is polygon pen color]. −N Do NOT skip symbols that fall outside map border [Default plots points inside border only].


Selects Overlay plot mode [Default initializes a new plot system].


Selects Portrait plotting mode [Default is Landscape, see gmtdefaults to change this].


Turn off the automatic sorting of items based on their distance from the viewer. The default is to sort the items so that items in the foreground are plotted after items in the background.


Plot symbols. If present, size is symbol size in the unit set in .gmtdefaults4 (unless c, i, m, or p is appended). If the symbol code (see below) is not given it will be read from the last column in the input data; this cannot be used in conjunction with −b. Optionally, append c, i, m, p to indicate that the size information in the input data is in units of cm, inch, meter, or point, respectively [Default is MEASURE_UNIT]. Note: if you give both size and symbol via the input file you must use MEASURE_UNIT to indicate the units used for the symbol size. The uppercase symbols A, C, D, G, H, I, N, S, T are normalized to have the same area as a circle with diameter size, while the size of the corresponding lowercase symbols refers to the diameter of a circumscribed circle. Choose between these symbol codes:


x-dash (-). size is the length of a short horizontal (x-dir) line segment.


plus (+). size is diameter of circumscribing circle.


star. size is diameter of circumscribing circle.


Vertical bar extending from base to y. size is bar width. Append u if size is in x-units [Default is plot-distance units]. By default, base = ymin. Append bbase to change this value.


Horizontal bar extending from base to x. size is bar width. Append u if size is in y-units [Default is plot-distance units]. By default, base = xmin. Append bbase to change this value.


circle. size is diameter of circle.


diamond. size is diameter of circumscribing circle.


ellipse. Direction (in degrees counter-clockwise from horizontal), major_axis, and minor_axis must be found in columns 4, 5, and 6.


Same as −Se, 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 (−Se leaves the directions unchanged.) Furthermore, the axes lengths must be given in km instead of plot-distance units. An exception occurs for a linear projection in which we assume the ellipse axes are given in the same units as −R.


front. −Sfgap/size[dir][type][:offset]. Supply distance gap between symbols and symbol size. If gap is negative, it is interpreted to mean the number of symbols along the front instead. Append dir to plot symbols on the left or right side of the front [Default is centered]. Append type to specify which symbol to plot: box, circle, fault, slip, or triangle. [Default is fault]. Slip means left-lateral or right-lateral strike-slip arrows (centered is not an option). Append :offset to offset the first symbol from the beginning of the front by that amount [Default is 0].


octagon. size is diameter of circumscribing circle.


hexagon. size is diameter of circumscribing circle.


inverted triangle. size is diameter of circumscribing circle.


Rotated rectangle. Direction (in degrees counter-clockwise from horizontal), x-dimension, and y-dimension must be found in columns 4, 5, and 6.


Same as −Sj, 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 (−Sj leaves the directions unchanged.) Furthermore, the dimensions must be given in km instead of plot-distance units. An exception occurs for a linear projection in which we assume the dimensions are given in the same units as −R.


kustom symbol. Append <name>/size, and we will look for a definition file called <name>.def in (1) the current directory or (2) in ~/.gmt or (3) in $GMT_SHAREDIR/custom. The symbol as defined in that file is of size 1.0 by default; the appended size will scale symbol accordingly. The symbols are plotted in the x-y plane. Users may add their own custom *.def files; see CUSTOM SYMBOLS in the psxy man page.


letter or text string (less than 64 characters). Give size, 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 *. Optionally, you may append %font to select a particular font [Default is ANNOT_FONT_PRIMARY].


math angle arc, optionally with one or two arrow heads [NOT IMPLEMENTED YET]. The size is the radius of the arc. Start and stop directions (in degrees counter-clockwise from horizontal) for arc must be found in columns 3 and 4. Use −Smf to add arrow head at first angle, −Sml for arrow head at last angle, and −Smb for both [Default is no arrow heads].


pentagon. size is diameter of circumscribing circle.


column (3-D) extending from base to z. size sets base width (Use xsize/ysize if not the same). Append u if size is in x-units [Default is plot-distance units]. If no size is given we expect both xsize and ysize as two extra data columns. By default, base = 0. Append bbase to change this value. The facet colors will be modified to simulate shading. Use −SO to disable such 3-D illumination.


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


quoted line, i.e., lines with annotations such as contours. It is assumed that each individual line has a constant z level (i.e., each line must lie in the x-y plane). Append [d|f|n|l|x]info[:labelinfo]. The required argument controls the placement of labels along the quoted lines. Choose among five controlling algorithms:

ddist[c|i|m|p] or Ddist[d|e|k|m|n]

For lower case d, give distances between labels on the plot in your preferred measurement unit c (cm), i (inch), m (meter), or p (points), while for upper case D, specify distances in map units and append the unit; choose among e (m), k (km), m (mile), n (nautical mile), or d (spherical degree). [Default is 10c or 4i].


Reads the ascii file ffile.d and places labels at locations in the file that matches locations along the quoted lines. Inexact matches and points outside the region are skipped.


Give the coordinates of the end points for one or more comma-separated straight line segments. Labels will be placed where these lines intersect the quoted lines. The format of each line specification is start_lon/start_lat/stop_lon/stop_lat. Both start_lon/start_lat and stop_lon/stop_lat can be replaced by a 2-character key that uses the justification format employed in pstext to indicate a point on the map, given as [LCR][BMT].
will interpret the point pairs as defining great circles [Default is straight line].


Specifies the number of equidistant labels for quoted lines line [1]. Upper case N starts labeling exactly at the start of the line [Default centers them along the line]. N-1 places one justified label at start, while N+1 places one justified label at the end of quoted lines. Optionally, append /min_dist[c|i|m|p] to enforce that a minimum distance separation between successive labels is enforced.


Reads the multi-segment file xfile.d and places labels at the intersections between the quoted lines and the lines inxfile.d. X will resample the lines first along great-circle arcs.

In addition, you may optionally append +rradius[c|i|m|p] to set a minimum label separation in the x-y plane [no limitation].

The optional labelinfo controls the specifics of the label formatting and consists of a concatenated string made up of any of the following control arguments:

For annotations at a fixed angle, +an for line-normal, or +ap for line-parallel [Default].


Sets the clearance between label and optional text box. Append c|i|m|p to specify the unit or % to indicate a percentage of the label font size [15%].


Turns on debug which will draw helper points and lines to illustrate the workings of the quoted line setup.


Sets the desired font [Default ANNOT_FONT_PRIMARY].


Selects opaque text boxes [Default is transparent]; optionally specify the color [Default is PAGE_COLOR]. (See SPECIFYING COLOR below).


Sets label justification [Default is MC]. Ignored when -SqN|n+|-1 is used.


Sets color of text labels [Default is COLOR_BACKGROUND]. (See SPECIFYING COLOR below).


Sets the constant label text.


Sets the label text according to the specified flag:


Take the label from the current multisegment header (first scan for an embedded −Llabel option, if not use the first word following the segment flag). For multiple-word labels, enclose entire label in double quotes.


Take the Cartesian plot distances along the line as the label; append c|i|m|p as the unit [Default is MEASURE_UNIT].


Calculate actual map distances; append d|e|k|m|n as the unit [Default is d(egrees), unless label placement was based on map distances along the lines in which case we use the same unit specified for that algorithm]. Requires a map projection to be used.


Use text after the 2nd column in the fixed label location file as the label. Requires the fixed label location setting.


As +Lh but use the headers in the xfile.d instead. Requires the crossing file option.


Nudges the placement of labels by the specified amount (append c|i|m|p to specify the units). Increments are considered in the coordinate system defined by the orientation of the line; use +N to force increments in the plot x/y coordinates system [no nudging].


Selects rounded rectangular text box [Default is rectangular]. Not applicable for curved text (+v) and only makes sense for opaque text boxes.


Draws the outline of text boxsets [Default is no outline]; optionally specify pen for outline [Default is width = 0.25p, color = black, texture = solid]. (See SPECIFYING PENS below).


Will not place labels where the line’s radius of curvature is less than min_rad [Default is 0].


Sets the desired font size in points [Default is 9].


Appends unit to all line labels. If unit starts with a leading hyphen (-) then there will be no space between label value and the unit. [Default is no unit].


Specifies curved labels following the path [Default is straight labels].


Specifies how many (x, y) points will be used to estimate label angles [Default is 10].


Prepends prefix to all line labels. If prefix starts with a leading hyphen (-) then there will be no space between label value and the prefix. [Default is no prefix].


rectangle. No size needs to be specified, but the x- and y-dimensions must be found in columns 4 and 5.


square. size is diameter of circumscribing circle.


triangle. size is diameter of circumscribing circle.


cube (3-D). size sets length of all sides. Append u if size is in x-units [Default is plot-distance units]. The facet colors will be modified to simulate shading. Use −SU to disable such 3-D illumination.


vector. Direction and length must be found in columns 4 and 5 (this is a vector in the horizontal plane). size, if present, will be interpreted as arrowwidth/headlength/headwidth [Default unit is 0.075c/0.3c/0.25c (or 0.03i/0.12i/0.1i)]. 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. To center vector on balance point, use −Svb; to align point with the vector head, use −Svh; to align point with the vector tail, use −Svt [Default]. To give the head point’s x, y, z coordinates instead of direction and length, use −Svs. Upper case B, H, T, S will draw a double-headed vector [Default is single head].


Same as −Sv, except azimuth should be given instead of direction. The azimuth will be mapped into an angle based on the chosen map projection (−Sv leaves the directions unchanged.)


pie wedge. Start and stop directions (in degrees counter-clockwise from horizontal) for pie slice must be found in columns 4 and 5.


Same as −Sw, except azimuths (in degrees east of north) should be given instead of the two directions. The azimuths will be mapped into angles based on the chosen map projection (−Sw leaves the directions unchanged.)


cross (x). size is diameter of circumscribing circle.


y-dash (|). size is the length of a short horizontal (y-dir) line segment.


zdash. size is the length of a short vertical (z-dir) line segment.


Draw Unix System time stamp on plot. By adding just/dx/dy/, the user may specify the justification of the stamp and where the stamp should fall on the page relative to lower left corner of the plot. For example, BL/0/0 will align the lower left corner of the time stamp with the lower left corner of the plot. Optionally, append a label, or c (which will plot the command string.). The GMT parameters UNIX_TIME, UNIX_TIME_POS, and UNIX_TIME_FORMAT can affect the appearance; see the gmtdefaults man page for details. The time string will be in the locale set by the environment variable TZ (generally local time).


Selects verbose mode, which will send progress reports to stderr [Default runs "silently"].


Set pen attributes for lines or the outline of symbols [Defaults: width = 1, color = black, texture = solid]. A leading + will use the lookup color (via −C) for both symbol fill and outline pen color, while a leading - will set outline pen color and turn off symbol fill. (See SPECIFYING PENS below).

−X −Y

Shift plot origin relative to the current origin by (x-shift,y-shift) and optionally append the length unit (c, i, m, p). You can prepend a to shift the origin back to the original position after plotting, or prepend r [Default] to reset the current origin to the new location. If −O is used then the default (x-shift,y-shift) is (0,0), otherwise it is (r1i, r1i) or (r2.5c, r2.5c). Alternatively, give c to align the center coordinate (x or y) of the plot with the center of the page based on current page size.


For 3-D projections: Sets the z-level of the basemap [lower end of z-range].


Toggles between (longitude,latitude) and (latitude,longitude) input and/or output. [Default is (longitude,latitude)]. Append i to select input only or o to select output only. [Default affects both].


Selects binary input. Append s for single precision [Default is d (double)]. Uppercase S or D will force byte-swapping. Optionally, append ncol, the number of columns in your binary input file if it exceeds the columns needed by the program. Or append c if the input file is netCDF. Optionally, append var1/var2/... to specify the variables to be read. [Default is the required number of columns given the chosen settings].


Specifies the number of plot copies. [Default is 1].


Special formatting of input and/or output columns (time or geographical data). Specify i or o to make this apply only to input or output [Default applies to both]. Give one or more columns (or column ranges) separated by commas. Append T (absolute calendar time), t (relative time in chosen TIME_UNIT since TIME_EPOCH), x (longitude), y (latitude), or f (floating point) to each column or column range item. Shorthand −f[i|o]g means −f[i|o]0x,1y (geographic coordinates).


Examine the spacing between consecutive data points in order to impose breaks in the line. Append x|X or y|Y to define a gap when there is a large enough change in the x or y coordinates, respectively, or d|D for distance gaps; use upper case to calculate gaps from projected coordinates. For gap-testing on other columns use [col]z; if col is not prepended the it defaults to 2 (i.e., 3rd column). Append [+|-]gap and optionally a unit u. Regarding optional signs: -ve means previous minus current column value must exceed |gap to be a gap, +ve means current minus previous column value must exceed gap, and no sign means the absolute value of the difference must exceed gap. For geographic data (x|y|d), the unit u may be meter [Default], kilometer, miles, or nautical miles. For projected data (X|Y|D), choose from inch, centimeter, meter, or points [Default unit set by MEASURE_UNIT]. Note: For x|y|z with time data the unit is instead controlled by TIME_UNIT. Repeat the option to specify multiple criteria, of which any can be met to produce a line break. Issue an additional −ga to indicate that all criteria must be met instead. The −g option is ignored if −S is set.


Multiple segment file. Segments are separated by a record whose first character is flag [Default is ’>’]. On these segment header records one or more of the following options can be added:

−Gfill Use the new fill and turn filling on
Turn filling off
Revert to default fill (none if not set on command line)
pen Use the new pen and turn outline on
Turn outline off
Revert to default pen (none if not set on command line)
zval Obtain fill via cpt lookup using z-value zval
Get the NaN color from the cpt file



The attributes of lines and symbol outlines as defined by pen is a comma delimetered list of width, color and texture, each of which is optional. width can be indicated as a measure (points, centimeters, inches) or as faint, thin[ner|nest], thick[er|est], fat[ter|test], or obese. color specifies a gray shade or color (see SPECIFYING COLOR below). texture is a combination of dashes ‘-’ and dots ‘.’.



The attribute fill specifies the solid shade or solid color (see SPECIFYING COLOR below) or the pattern used for filling polygons. Patterns are specified as pdpi/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. The dpi sets the resolution of the image. For 1-bit rasters: use Pdpi/pattern for inverse video, or append :Fcolor[B[color]] to specify fore- and background colors (use color = - for transparency). See GMT Cookbook & Technical Reference Appendix E for information on individual patterns.



The color of lines, areas and patterns can be specified by a valid color name; by a gray shade (in the range 0−255); by a decimal color code (r/g/b, each in range 0−255; h-s-v, ranges 0−360, 0−1, 0−1; or c/m/y/k, each in range 0−1); or by a hexadecimal color code (#rrggbb, as used in HTML). See the gmtcolors manpage for more information and a full list of color names.


To plot blue columns (width = 1.25 cm) at the positions listed in the file on a 3-D projection of the space (0−10), (0−10), (0−100), with tickmarks every 2, 2, and 10, viewing it from the southeast at 30 degree elevation, use:

psxyz −R 0/10/0/10/0/100 −Jx 1.25c −Jz 0.125c −So 1.25c −G blue −B 2:XLABEL:/2:YLABEL:/10:ZLABEL::."3-D PLOT":15 −E 135/30 −Uc −W −P >


No hidden line removal is employed for polygons and lines. Symbols, however, are first sorted according to their distance from the viewpoint so that nearby symbols will overprint more distant ones should they project to the same x,y position.
cannot handle filling of polygons that contain the south or north pole. For such a polygon, make a copy and split it into two and make each explicitly contain the polar point. The two polygons will combine to give the desired effect when filled; to draw outline use the original polygon.
The −N option does not adjust the BoundingBox information so you may have to post-process the PostScript output with ps2raster -A to obtain the correct BoundingBox.


GMT(1), gmtcolors(5), psbasemap(1), psxy(1)