psxy(1) Plot lines, polygons, and symbols on maps


psxy files -Jparameters -Rwest/east/south/north[r] [ -A ] [ -Btickinfo ] [ -Ccptfile ] [ -E[x|y|X|Y][cap][/pen] ] [ -Gfill ] [ -H[nrec] ] [ -K ] [ -L ] [ -N ] [ -M[flag] ] [ -O ] [ -P ] [ -S[symbol][size] ] [ -U[/dx/dy/][label] ] [ -V ] [ -W[pen] ] [ -Xx-shift ] [ -Yy-shift ] [ -: ] [ -ccopies ] [ -bi[s][n] ]


psxy reads (x,y) pairs from files [or standard input] and generates PostScript code that will plot lines, polygons, or symbols at those locations on a map. If a symbol is selected and no symbol size given, then psxy will interpret the third 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 selected, a line connecting the data points will be drawn instead. To explicitly close polygons, use -L. Select a shade 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 color and outline/no outline, respectively. The PostScript code is written to standard output.
List one or more file-names. If no files are given, psxy 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 .gmtdefaults, but this can be overridden on the command line by appending the c, i, or m to the scale/width value.


-Jclon0/lat0/scale (Cassini)
-Jjlon0/scale (Miller)
-Jmscale (Mercator - Greenwich and Equator as origin)
-Jmlon0/lat0/scale (Mercator - Give meridian and standard parallel)
-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, with Equator as y = 0)
-Jtlon0/lat0/scale (TM - Transverse Mercator, set origin)
-Juzone/scale (UTM - Universal Transverse Mercator)
-Jylon0/lats/scale (Basic Cylindrical Projection)


-Jalon0/lat0/scale (Lambert).
-Jelon0/lat0/scale (Equidistant).
-Jflon0/lat0/horizon/scale (Gnomonic).
-Jglon0/lat0/scale (Orthographic).
-Jslon0/lat0/[slat/]scale (General Stereographic)


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


-Jhlon0/scale (Hammer)
-Jilon0/scale (Sinusoidal)
-Jk[f|s]lon0/scale (Eckert IV (f) and VI (s))
-Jnlon0/scale (Robinson)
-Jrlon0/scale (Winkel Tripel)
-Jvlon0/scale (Van der Grinten)
-Jwlon0/scale (Mollweide)


-Jp[a]scale[/origin] (polar (theta,r) coordinates, optional a for azimuths and offset theta [0])
-Jxx-scale[l|ppow][/y-scale[l|ppow]] (Linear, log, and power scaling)
More details can be found in the psbasemap manpages.

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.


No space between the option flag and the associated arguments.
Suppress drawing line segments as great circle Arcs. [Default draws great circle arcs.]
Sets map boundary tickmark intervals. See psbasemap for details.
Give a color palette file. When used with -S, lets symbol color be determined by the z-value in the third column. Additional fields are shifted over by one column (optional size would be 4th rather than 3rd field, etc.). If -S is not set, psxy expects the user to supply a multisegment polygon file (requires -M) and will look for -Zval strings in each multisegment header. The val will control the color via the cpt file.
Draw error bars. Append x and/or y to indicate which bars you want to draw (Default is both x and y). The x and/or y errors must be stored in the columns after the (x,y) pair [or (x,y,size) triplet]. The cap parameter indicates the length of the end-cap on the error bars [0.25c (or 0.1i)]. Pen attributes for error bars may also be set. [Defaults: width = 1, color = 0/0/0, texture = solid]. If upper case X and/or Y is used we will instead draw "box-and-whisker" (or "stem-and-leaf") symbols. The x (or y) coordinate is then taken as the median value, and 4 more columns are expected to contain the minimum (0% quartile), the 25% quartile, the 75% quartile, and the maximum (100% quartile) values. The 25-75% box may be filled by using -G.
Select filling of polygons and symbols. Append the shade (0-255), color (r/g/b), or P|pdpi/pattern (polygons only) [Default is no fill]. Note when -M is chosen, psxy will search for -G and -W strings in all the subheaders and let any found values over-ride the command line settings.
Input file(s) has Header record(s). Number of header records can be changed by editing your .gmtdefaults file. If used, GMT default is 1 header record.
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.
Multiple segment file. Segments are separated by a record whose first character is flag. [Default is '>'].
Do NOT skip symbols that fall outside map border [Default plots points inside border only]. The option does not apply to lines and polygons which are always clipped to the map region.
Selects binary output. Append s for single precision [Default is double].
Selects Portrait plotting mode [GMT Default is Landscape, see gmtdefaults to change this].
Plot symbols. If present, size is symbol size in the unit set in .gmtdefaults (unless c, i, m, or p is appended). The uppercase symbols A, C, D, H, I, S, T are normalized to have the same area as the circle, while the corresponding lowercase symbols all are circumscribed by the circle. Choose between these symbol codes:
Read symbol code (see below) from last column in the input data. 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].
star. size is diameter of circumscribing circle.
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 = 0. 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 3, 4, and 5.
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.
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].
hexagon. size is diameter of circumscribing circle.
inverted triangle. size is diameter of circumscribing circle.
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 ANOT_FONT].
point. No size needs to be specified (1 pixel is used).
square. size is diameter of circumscribing circle.
triangle. size is diameter of circumscribing circle.
vector. Direction (in degrees counter-clockwise from horizontal) and length must be found in columns 3 and 4. size, if present, will be interpreted as arrowwidth/headlength/headwidth [Default 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.
Same as -Sv, 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 (-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 3 and 4.
cross. size is diameter of circumscribing circle.
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. Optionally, append a label, or c (which will plot the command string.). The GMT parameters UNIX_TIME and UNIX_TIME_POS can affect the appearance; see the gmtdefaults man page for details.
Selects verbose mode, which will send progress reports to stderr [Default runs "silently"].
Set pen attributes. [Defaults: width = 1, color = 0/0/0, texture = solid]. Implicitly draws the outline of symbols with selected pen.
-X -Y
Shift origin of plot by (x-shift,y-shift). Prepend a for absolute coordinates; the default (r) will reset plot origin.
Toggles between (longitude,latitude) and (latitude,longitude) input/output. [Default is (longitude,latitude)]. Applies to geographic coordinates only.
Specifies the number of plot copies. [Default is 1]
Selects binary input. Append s for single precision [Default is double]. Append n for the number of columns in the binary file(s). [Default is the required number of columns given the chosen settings].


To plot solid red circles (diameter = 0.25 cm) at the positions listed in the file DSDP.xy on a Mercator map at 5 cm/degree of the area 150E to 154E, 18N to 23N, with tickmarks every 1 degree and gridlines every 15 minutes, try:

psxy DSDP.xy -R150/154/18/23 -Jm5c -Sc0.25c -G255/0/0 -B1g15m | lpr

To plot the xyz values in the file quakes.xyzm as circles with size given by the magnitude in the 4th column and color based on the depth in the third using the color palette cpt on a linear map, try

psxy quakes.xyzm -R0/1000/0/1000 -JX6i -Sc -Ccpt -B200 >

To plot the file trench.xy on a Mercator map, with white triangles with sides 0.25 inch on the left side of the line, spaced every 0.8 inch, use

psxy trench.xy -R150/200/20/50 -Jm0.15i -Sf0.8i/0.1ilt -G255 -W -B10 | lpr br

To plot the data in the file misc.d as symbols determined by the code in the last column, and with size given by the magnitude in the 4th column, and color based on the third column via the color palette cpt on a linear map, try

psxy misc.d -R0/100/-50/100 -JX6i -S -Ccpt -B20 >


The -N option does not adjust the BoundingBox information so you may have to post-process the PostScript outout with epstool or ps2epsi to obtain a correct BoundingBox.
psxy 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.