1PSCONTOUR(1)                 Generic Mapping Tools                PSCONTOUR(1)
2
3
4

NAME

6       pscontour - Contour xyz-data by direct triangulation [method]
7

SYNOPSIS

9       pscontour  xyzfile  -Ccptfile -Jparameters -Rwest/east/south/north[r] [
10       -A[-][labelinfo]  ]  [  -B[p|s]parameters  ]   [   -D[dumpfile]   ]   [
11       -Eview_az/view_el  ] [ -G[d|f|n|l|L|x|X]params ] [ -H[i][nrec] ] [ -I ]
12       [ -K ] [ -Lpen ] [ -M[flag] ] [ -N ] [ -O ] [ -P ] [ -S ] [ -Tindexfile
13       ]  [  -U[just/dx/dy/][c|label]  ]  [  -V  ] [ -W[+]pen ] [ -X[a|c|r][x-
14       shift[u]] ] [ -Y[a|c|r][y-shift[u]] ]  [  -ccopies  ]  [  -:[i|o]  ]  [
15       -b[i|o][s|S|d|D[ncol]|c[var1/...]] ]
16

DESCRIPTION

18       pscontour  reads  an ASCII [or binary] xyz-file and produces a raw con‐
19       tour plot by triangulation.  By default, the optimal Delaunay  triangu‐
20       lation  is performed (using either Shewchuk's [1996] or Watson's [1982]
21       method as selected during GMT installation; type  pscontour  -  to  see
22       which method is selected), but the user may optionally provide a second
23       file with network information, such  as  a  triangular  mesh  used  for
24       finite  element  modeling.   In  addition to contours, the area between
25       contours may be painted according to the color palette file.
26
27       xyzfile
28              Raw ASCII (or binary, see -b) xyz data to be contoured.
29
30       -C     name of the color palette file.  Must have  discrete  colors  if
31              you  want  to  paint  the surface (-I).  Only contours that have
32              annotation flags set will be annotated.
33
34       -J     Selects the map projection. Scale is  UNIT/degree,  1:xxxxx,  or
35              width  in  UNIT  (upper case modifier).  UNIT is cm, inch, or m,
36              depending on the MEASURE_UNIT setting in .gmtdefaults4, but this
37              can be overridden on the command line by appending c, i, or m to
38              the scale/width  value.   When  central  meridian  is  optional,
39              default  is  center  of  longitude  range on -R option.  Default
40              standard parallel is the equator.  For map  height,  max  dimen‐
41              sion,  or min dimension, append h, +, or - to the width, respec‐
42              tively.
43              More details can be found in the psbasemap man pages.
44
45              CYLINDRICAL PROJECTIONS:
46
47              -Jclon0/lat0/scale (Cassini)
48              -Jcyl_stere/[lon0/[lat0/]]scale (Cylindrical Stereographic)
49              -Jj[lon0/]scale (Miller)
50              -Jm[lon0/[lat0/]]scale (Mercator)
51              -Jmlon0/lat0/scale (Mercator - Give meridian and standard paral‐
52              lel)
53              -Jo[a]lon0/lat0/azimuth/scale  (Oblique  Mercator  -  point  and
54              azimuth)
55              -Jo[b]lon0/lat0/lon1/lat1/scale (Oblique Mercator - two points)
56              -Joclon0/lat0/lonp/latp/scale  (Oblique  Mercator  -  point  and
57              pole)
58              -Jq[lon0/[lat0/]]scale (Cylindrical Equidistant)
59              -Jtlon0/[lat0/]scale (TM - Transverse Mercator)
60              -Juzone/scale (UTM - Universal Transverse Mercator)
61              -Jy[lon0/[lat0/]]scale (Cylindrical Equal-Area)
62
63              CONIC PROJECTIONS:
64
65              -Jblon0/lat0/lat1/lat2/scale (Albers)
66              -Jdlon0/lat0/lat1/lat2/scale (Conic Equidistant)
67              -Jllon0/lat0/lat1/lat2/scale (Lambert Conic Conformal)
68
69              AZIMUTHAL PROJECTIONS:
70
71              -Jalon0/lat0[/horizon]/scale (Lambert Azimuthal Equal-Area)
72              -Jelon0/lat0[/horizon]/scale (Azimuthal Equidistant)
73              -Jflon0/lat0[/horizon]/scale (Gnomonic)
74              -Jglon0/lat0[/horizon]/scale (Orthographic)
75              -Jglon0/lat0/altitude/azimuth/tilt/twist/Width/Height/scale
76              (General Perspective).
77              -Jslon0/lat0[/horizon][/slat]/scale (General Stereographic)
78
79              MISCELLANEOUS PROJECTIONS:
80
81              -Jh[lon0/]scale (Hammer)
82              -Ji[lon0/]scale (Sinusoidal)
83              -Jkf[lon0/]scale (Eckert IV)
84              -Jk[s][lon0/]scale (Eckert IV)
85              -Jn[lon0/]scale (Robinson)
86              -Jr[lon0/]scale (Winkel Tripel)
87              -Jv[lon0/]scale (Van der Grinten)
88              -Jw[lon0/]scale (Mollweide)
89
90              NON-GEOGRAPHICAL PROJECTIONS:
91
92              -Jp[a]scale[/origin][r|z] (Polar coordinates (theta,r))
93              -Jxx-scale[d|l|ppow|t|T][/y-scale[d|l|ppow|t|T]]  (Linear,  log,
94              and power scaling)
95
96       -R     xmin,  xmax, ymin, and ymax specify the Region of interest.  For
97              geographic regions,  these  limits  correspond  to  west,  east,
98              south,  and north and you may specify them in decimal degrees or
99              in [+-]dd:mm[:ss.xxx][W|E|S|N] format.  Append r if  lower  left
100              and  upper  right  map coordinates are given instead of w/e/s/n.
101              The two shorthands -Rg and -Rd stand for  global  domain  (0/360
102              and  -180/+180  in longitude respectively, with -90/+90 in lati‐
103              tude).  For calendar time coordinates you may  either  give  (a)
104              relative  time  (relative  to the selected TIME_EPOCH and in the
105              selected TIME_UNIT; append t to -JX|x), or (b) absolute time  of
106              the  form  [date]T[clock]  (append T to -JX|x).  At least one of
107              date and clock must be present; the T is always  required.   The
108              date  string  must  be  of the form [-]yyyy[-mm[-dd]] (Gregorian
109              calendar) or yyyy[-Www[-d]] (ISO week calendar), while the clock
110              string  must  be  of the form hh:mm:ss[.xxx].  The use of delim‐
111              iters and their type and positions must be exactly as  indicated
112              (however,  input,  output and plot formats are customizable; see
113              gmtdefaults).
114

OPTIONS

116       No space between the option flag and the associated arguments.
117
118       -A     Give - to disable all annotations.  The optional labelinfo  con‐
119              trols  the  specifics  of the label formatting and consists of a
120              concatenated string made up of  any  of  the  following  control
121              arguments:
122
123              +aangle
124                     For annotations at a fixed angle, +an for line-normal, or
125                     +ap for line-parallel [Default].
126
127              +cdx[/dy]
128                     Sets the clearance between label and optional  text  box.
129                     Append  c|i|m|p  to  specify  the unit or % to indicate a
130                     percentage of the label font size [15%].
131
132              +d     Turns on debug which will draw helper points and lines to
133                     illustrate the workings of the quoted line setup.
134
135              +ffont Sets the desired font [Default ANNOT_FONT_PRIMARY].
136
137              +g[color]
138                     Selects  opaque  text  boxes  [Default  is  transparent];
139                     optionally specify the  color  [Default  is  PAGE_COLOR].
140                     (See SPECIFYING COLOR below).
141
142              +jjust Sets  label  justification [Default is MC].  Ignored when
143                     -SqN|n+|-1 is used.
144
145              +kcolor
146                     Sets color of text labels [Default is  COLOR_BACKGROUND].
147                     (See SPECIFYING COLOR below).
148
149              +llabel
150                     Sets the constant label text.
151
152              +Lflag Sets the label text according to the specified flag:
153
154                     +Lh    Take  the  label  from  the  current  multisegment
155                            header (first scan for an embedded -Llabel option,
156                            if  not  use  the first word following the segment
157                            flag).  For multiple-word labels,  enclose  entire
158                            label in double quotes.
159
160                     +Ld    Take  the  Cartesian plot distances along the line
161                            as the label; append c|i|m|p as the unit  [Default
162                            is MEASURE_UNIT].
163
164                     +LD    Calculate  actual  map distances; append d|e|k|m|n
165                            as the unit [Default is  d(egrees),  unless  label
166                            placement  was  based  on  map distances along the
167                            lines in which case we use the same unit specified
168                            for that algorithm].  Requires a map projection to
169                            be used.
170
171                     +Lf    Use text after the 2nd column in the  fixed  label
172                            location  file  as  the label.  Requires the fixed
173                            label location setting.
174
175                     +Lx    As +Lh but use the headers in the xfile.d instead.
176                            Requires the crossing file option.
177
178              +ndx[/dy]
179                     Nudges  the  placement  of labels by the specified amount
180                     (append c|i|m|p to specify the  units).   Increments  are
181                     considered in the coordinate system defined by the orien‐
182                     tation of the line; use +N to  force  increments  in  the
183                     plot x/y coordinates system [no nudging].
184
185              +o     Selects  rounded rectangular text box [Default is rectan‐
186                     gular].  Not applicable for curved  text  (+v)  and  only
187                     makes sense for opaque text boxes.
188
189              +p[pen]
190                     Draws  the  outline  of  text boxsets [Default is no out‐
191                     line]; optionally specify pen  for  outline  [Default  is
192                     width  =  0.25p,  color  = black, texture = solid].  (See
193                     SPECIFYING PENS below).
194
195              +rmin_rad
196                     Will not place labels where the line's radius  of  curva‐
197                     ture is less than min_rad [Default is 0].
198
199              +ssize Sets the desired font size in points [Default is 9].
200
201              +uunit Appends  unit  to  all line labels. If unit starts with a
202                     leading hypen (-) then there will  be  no  space  between
203                     label value and the unit.  [Default is no unit].
204
205              +v     Specifies  curved  labels  following the path [Default is
206                     straight labels].
207
208              +w     Specifies how many (x, y) points will be used to estimate
209                     label angles [Default is 10].
210
211              +=prefix
212                     Prepends  prefix  to  all  line labels.  If prefix starts
213                     with a leading hypen (-) then  there  will  be  no  space
214                     between  label  value and the prefix. [Default is no pre‐
215                     fix].
216
217       -B     Sets map boundary annotation and  tickmark  intervals;  see  the
218              psbasemap man page for all the details.
219
220       -D     Dump  the (x,y,z) coordinates of each contour to separate files,
221              one for each contour segment. The  files  will  be  named  dump‐
222              file_cont_segment[_i].xyz,  where  cont is the contour value and
223              segment is a running segment number for  each  contour  interval
224              (for closed contours we append _i.)  However, when -M is used in
225              conjunction with  -D  a  single  multisegment  file  is  created
226              instead.
227
228       -E     Sets  the  view  point  by  specifying  azimuth and elevation in
229              degrees. [Default is 180/90].
230
231       -G     Controls the placement of labels  along  the  contours.   Choose
232              among five controlling algorithms:
233
234              -Gddist[c|i|m|p] or -GDdist[d|e|k|m|n]
235                     For  lower  case  d, give distances between labels on the
236                     plot in your preferred measurement unit c (cm), i (inch),
237                     m (meter), or p (points), while for upper case D, specify
238                     distances in map units and append the unit; choose  among
239                     e (m), k (km), m (mile), n (nautical mile), or d (spheri‐
240                     cal degree).  [Default is 10c or 4i].
241
242              -Gfffile.d
243                     Reads the ascii file ffile.d and places labels  at  loca‐
244                     tions  in  the file that matches locations along the con‐
245                     tours.  Inexact mathces and points outside the region are
246                     skipped.
247
248              -Gl|Lline1[,line2,...]
249                     Give  start  and  stop coordinates for one or more comma-
250                     separated straight line segments.  Labels will be  placed
251                     where  these lines intersect the contours.  The format of
252                     each line specification is start/stop,  where  start  and
253                     stop  are either a specified point lon/lat or a 2-charac‐
254                     ter XY key that uses the justification format employed in
255                     pstext   to  indicate  a  point  on  the  map,  given  as
256                     [LCR][BMT].  -GL will interpret the point pairs as defin‐
257                     ing great circles [Default is straight line].
258
259              -Gnn_label
260                     Specifies  the  number of equidistant labels for contours
261                     line [1].  Upper case -GN starts labeling exactly at  the
262                     start  of the line [Default centers them along the line].
263                     -GN-1 places one justified label at  start,  while  -GN+1
264                     places  one  justified  label  at  the  end  of contours.
265                     Optionally, append /min_dist[c|i|m|p] to enforce  that  a
266                     minimum  distance separation between successive labels is
267                     enforced.
268
269              -Gx|Xxfile.d
270                     Reads the multi-segment file xfile.d and places labels at
271                     the intersections between the contours and the lines inx‐
272                     file.d.  -GX will resample the lines first  along  great-
273                     circle arcs.
274       In  addition, you may optionally append :radius[c|i|m|p] to set a mini‐
275       mum label separation in the x-y plane [no limitation].
276
277       -H     Input file(s) has Header record(s).  Number  of  header  records
278              can be changed by editing your .gmtdefaults4 file.  If used, GMT
279              default is 1 header record. Use -Hi if only  input  data  should
280              have  header  records  [Default will write out header records if
281              the input data have them]. Blank lines and lines starting with #
282              are always skipped.
283
284       -I     Color the triangles using the color palette table.
285
286       -Jz    Sets the vertical scaling (for 3-D maps).  Same syntax as -Jx.
287
288       -K     More  PostScript code will be appended later [Default terminates
289              the plot system].
290
291       -L     Draw the underlying triangular  mesh  using  the  specified  pen
292              attributes [Default is no mesh].  (See SPECIFYING PENS below).
293
294       -M     When  used  in conjunction with -D a single multisegment file is
295              created, and each contour section is preceded by a header record
296              whose first column is flag followed by the contour level.
297
298       -N     Do  NOT  clip  contours or image at the boundaries [Default will
299              clip to fit inside region -R].
300
301       -O     Selects Overlay plot mode [Default initializes a new  plot  sys‐
302              tem].
303
304       -P     Selects Portrait plotting mode [Default is Landscape, see gmtde‐
305              faults to change this].
306
307       -S     Skip all input xyz points that fall outside the region  [Default
308              uses all the data in the triangulation].
309
310       -T     Give  name  of  file with network information.  Each record must
311              contain triplets of node numbers for a  triangle  [Default  com‐
312              putes these using Delaunay triangulation (see triangulate)].
313
314       -U     Draw Unix System time stamp on plot.  By adding just/dx/dy/, the
315              user may specify the justification of the stamp  and  where  the
316              stamp  should  fall on the page relative to lower left corner of
317              the plot.  For example, BL/0/0 will align the lower left  corner
318              of  the  time  stamp  with  the  lower  left corner of the plot.
319              Optionally, append a label, or c (which will  plot  the  command
320              string.).   The  GMT  parameters  UNIX_TIME,  UNIX_TIME_POS, and
321              UNIX_TIME_FORMAT can affect the appearance; see the  gmtdefaults
322              man page for details.  The time string will be in the locale set
323              by the environment variable TZ (generally local time).
324
325       -V     Selects verbose mode, which will send progress reports to stderr
326              [Default runs "silently"].
327
328       -W     Select contouring and set contour pen attributes.  If the + flag
329              is set then the contour lines are colored according to  the  cpt
330              file (see -C).  (See SPECIFYING PENS below).
331
332       -X -Y  Shift  plot origin relative to the current origin by (x-shift,y-
333              shift) and optionally append the length unit (c, i, m, p).   You
334              can  prepend a to shift the origin back to the original position
335              after plotting, or prepend  r [Default]  to  reset  the  current
336              origin  to the new location.  If -O is used then the default (x-
337              shift,y-shift) is (0,0), otherwise it is (r1i, r1i)  or  (r2.5c,
338              r2.5c).  Alternatively, give c to align the center coordinate (x
339              or y) of the plot with the center of the page based  on  current
340              page size.
341
342       -:     Toggles  between  (longitude,latitude)  and (latitude,longitude)
343              input and/or output.  [Default is (longitude,latitude)].  Append
344              i  to  select  input  only or o to select output only.  [Default
345              affects both].
346
347       -bi    Selects binary input.  Append s for single precision [Default is
348              d  (double)].   Uppercase  S  or  D  will  force  byte-swapping.
349              Optionally, append ncol, the number of columns  in  your  binary
350              input  file if it exceeds the columns needed by the program.  Or
351              append c  if  the  input  file  is  netCDF.  Optionally,  append
352              var1/var2/...  to specify the variables to be read.  [Default is
353              3 input columns].  Use 4-byte  integer  triplets  for  node  ids
354              (-T).
355
356       -bo    Selects  binary  output.  Append s for single precision [Default
357              is d (double)].  Uppercase S  or  D  will  force  byte-swapping.
358              Optionally,  append  ncol, the number of desired columns in your
359              binary output file.  [Default is 3 output columns].
360
361       -c     Specifies the number of plot copies. [Default is 1].
362
363   SPECIFYING PENS
364       pen    The attributes of lines and symbol outlines as defined by pen is
365              a  comma  delimetered  list of width, color and texture, each of
366              which is optional.  width can be indicated as a measure (points,
367              centimeters, inches) or as faint, thin[ner|nest], thick[er|est],
368              fat[ter|test], or obese.  color specifies a grey shade or  color
369              (see  SPECIFYING  COLOR  below).   texture  is  a combination of
370              dashes `-' and dots `.'.
371
372   SPECIFYING COLOR
373       color  The color of lines, areas and patterns can  be  specified  by  a
374              valid  color  name;  by  a grey shade (in the range 0-255); by a
375              decimal color code (r/g/b, each in range  0-255;  h-s-v,  ranges
376              0-360,  0-1,  0-1; or c/m/y/k, each in range 0-1); or by a hexa‐
377              decimal color code (#rrggbb, as used in HTML).  See the  gmtcol‐
378              ors manpage for more information and a full list of color names.
379

EXAMPLES

381       To  make a raw contour plot from the file topo.xyz and drawing the con‐
382       tours (pen = 2) given in the color palette file topo.cpt on  a  Lambert
383       map at 0.5 inch/degree along the standard parallels 18 and 24, use
384
385       pscontour  topo.xyz  -R320/330/20/30  -Jl18/24/0.5i -Ctopo.cpt -W0.5p >
386       topo.ps
387
388       To create a color PostScript plot of the numerical temperature solution
389       obtained  on  a triangular mesh whose node coordinates and temperatures
390       are stored in temp.xyz and  mesh  arrangement  is  given  by  the  file
391       mesh.ijk, using the colors in temp.cpt, run
392
393       pscontour temp.xyz -R0/150/0/100 -Jx0.1 -Ctemp.cpt -G -W0.25p > temp.ps
394

BUGS

396       Sometimes  there will appear to be thin lines of the wrong color in the
397       image.  This is a round-off problem which may be remedied  by  using  a
398       higher value of DOTS_PR_INCH in the .gmtdefaults4 file.
399

SEE ALSO

401       GMT(1), grdcontour(1), grdimage(1), nearneighbor(1), psbasemap(1), pss‐
402       cale(1), surface(1), triangulate(1)
403

REFERENCES

405       Watson, D. F., 1982, Acord: Automatic contouring of raw data,  Comp.  &
406       Geosci., 8, 97-101.
407       Shewchuk,  J. R., 1996, Triangle: Engineering a 2D Quality Mesh Genera‐
408       tor and Delaunay Triangulator, First Workshop on Applied  Computational
409       Geometry (Philadelphia, PA), 124-133, ACM, May 1996.
410       www.cs.cmu.edu/~quake/triangle.html
411
412
413
414GMT 4.3.1                         15 May 2008                     PSCONTOUR(1)
Impressum