Ps.output

From GRASS-Wiki
Jump to navigation Jump to search

The ps.out try to update the standard postscript output of Grass adding new features to design borders, graticules, categorized legends, etc

Command line flags

-d Draw a 1x1 cm grid on paper to help the placement of the elements of the map.

-e Make an output file without the postscript header. Useful when is embebed into other ps.out map.

-g Use the extended PostScript of Ghostscript (for transparent colors only)

-s Draw the small digit in the coordinate numbers to lower instead upper possition.

Generic Instructions

font

line

frame

dimen

Map paper

paper

The block paper has an online value to define the base size of the paper. Valid options are: B0-6, A0-6, Legal, Ledger, Tabloid, Executive, or Folio. For all, the default left and right margins are 0.5 inch, and 1 inch in top and bottom margins. Custom dimensions are possibles with commands height and width while margins with the commands left, right, top, and bottom.

Also, in ps.out is possible define the backcolor of the paper (color), orientation (landscape), default font (font) and free draw of decorates as watermarks before any feature of the map is drawn (draw).

commands

paper [B0-6|A0-6|Legal|Ledger|Tabloid|Executive|Folio]. Default A4.
Type of paper.

color (color). Optional.
Paper color.

width (dimen), and height (dimen). Optional.
Custom size of paper.

left (dimen), right (dimen), top (dimen), and bottom (dimen). Optional, default 0.5" left and right, and 1" top and bottom.
Custom margins.

landscape yes|no. Optional, default no
Paper orientation.

font. Optional.
Block font.

draw. Optional.
Block draw.

scale

Simple command to define the scale of the map (default adjust map to the paper dimensions). For example, scale 1:500000 to rescale maparea dimensions.

commands

scale 1:(number).
Scale of map, if possible.

maparea

The block maparea define specific dimensions of the map (default defined by command scale). In particular height, widht, and the positions in the paper with left and top.

There are two special command: color, define the color of the border of the map (draw with grid...); and border, define the width of the border of the map (usefull with in and out formats).

commands

border (dimen)

color (color)

fcolor (color)

width (dimen) and height (dimen)

top (dimen) and bottom (dimen)

palette

Common elements on the map

grid and geogrid

Draw a graticula around the map. Predefined format: iho, can, in, out, or +out (numbers in the four limits of the map).

Many modifications are possibles to change color and style of the major and minir lines, trim zeros, etc. For example, to draw a typical border you must use the border set to 0.8mm in a maparea block, select the format out, set the style and color of the subdivisions, etc

scalebar

Maximun 5 scalebars in each map.

note

The block note permit write text on any place of the paper with frame, etc (also draw permit write text in paper). This command has an inline value with the text; this text can be a keywords: :maplimits, :dimen, :scale, or :file (to read the text from file); or free text in one line using '|' to break lines and '.' as first character to center line.

Maximun 20 notes by map.

draw

The block draw run over map and all is clipped to the map limits. This command draw predefined postscript code.

However, there is an optional value to modify this feature. Valid options are: (1) paper: run before any map feature is drawn (equivalent to place inside paper block); and (2) free: run after all map features are drawn then it's draw over map but not clipped.

Raster maps

raster

This block draw one or two raster maps on the maparea.

The following gallery show the output of the commands inside the raster block (all mapnames are of type raster).

raster elevation
end
raster elevation
  grey yes
end
raster lsat5.5 lsat5.4 lsat5.3
end
raster zipcodes_wake
  maskcell zipcodes_wake
  maskcolor 200:200:120
end
raster elevation
  maskcell census_26 elevation
end
raster elevation
  maskcell census_26 elevation
  maskcolor indigo
end
raster zipcodes_wake
  maskcell zipcodes_wake elev_state_500m
  outline
    width .2mm
  end
end
raster zipcodes_wake
  maskcell zipcodes_wake elev_state_500m
  outline 
    width .2mm
    color white
  end
  setcolor 37 black
end

commands

raster (map|map.R map.G map.B|:group)
The inline value is the raster mapname, three maps to draw as RGB, or a groupname (leader by ':') with tree RGB maps.

grey yes|no
Optional. Draw the rasters in grey scale (small size of file).

maskcell (mask) [(background)]
Optional. Set the map to use as mask (independent of the mask set in GRASS with r.mask) and, optionally, the raster map uses as background.

maskcolor (color)
Optional. Set the color of the mask. If a raster map as background is set then it's drawn with a scale white-maskcolor.

outline
Optional. Block line to define ...

setcolor (cat) (color)
Optional, multiple. Replace the color of the cat area with a new color.

Vector maps

common commands

All commands are optional.

layer (number)
Layer number used with cats/where option.

cats (n1,n2,...)
List of cats to show.

where (sql)
Argument of the SQL where clausule to filter the areas to show.

masked yes|no
Masked or not by raster mask (default no).

label (text)
For description or title in vlegend.

lpos (number) or legend (number)
Position where vector is plotted in legend and block.

vareas

vareas geology
  where GEO_NAME LIKE 'Zb'
  pat ../patterns/diag_up.eps
  pscale .5
end
vareas geology
  where GEO_NAME LIKE 'Zb'
  pat ../patterns/diag_up.eps
  pscale .5
  fcolor indigo
end
vareas geology
  where GEO_NAME LIKE 'Zb'
  pat ../patterns/diag_up.eps
  pscale .5
  fcolor cat cat
  setrule 0-500:red 0-500
  setrule 500-1000:green 500-1000
  setrule 1000-5000:blue 1000-5000
end
vareas geology
  where GEO_NAME LIKE 'Zb'
  pat ../patterns/diag_up.eps
  pscale .5
  island no
  fcolor cat cat
  setrule 0-500:red 0-500
  setrule 500-1000:green 500-1000
  setrule 1000-5000:blue 1000-5000
end

commands

All commands are optional, except vareas (map) and end.

vareas (map)
map is a vector map of areas, except when lwidth is different to zero that map is a vector of lines.

line
Block line to set the style of the border line of the areas.

lwidth (dimen)
Line map draws as an area with a width = lwidth (positive or negative).

fcolor (color|column-color|column-color column)
Fill color and, optionally, name of the column of datase to apply the rules.

island yes|no
Draw island as normal areas (fill as normal area then hide it).

pat (epsfile)
Pattern in a EPS file.

pscale (number)
Scale of pattern.

pwidth (dimen)
Width of the lines of pattern.

setrule (n1-n2[:color] text
Make a item of a sublegend with label the text and title the text of the label. Also, the fillcolor of the areas of the map with column >= n1 and column < n2 (column from fcolor), is set to color.

vlines

vpoints

Legend of the maps

rlegend

The block rlegend show the legend of a raster map. In the following images are shown the two types of outputs: the left one when raster is 'category' and the right one when is 'gradient'. In the code, the frame sub-command is not shown, and the cols, swidth, height, and order commands are optionals. Also, the units meters in the gradient legend is set with r.support.

rlegend Zip Codes (wake)
  raster zipcodes_wake
  cols 2 0
  swidth 8mm
  order 20,10,30,22,34
end
rlegend
  raster elevation
  height 8cm
end
rlegend
  raster elevation
  width 8cm
  vertical no
end

commands

rlegend [text].
Text is the title of the legend.

raster (map).
raster map from take the data of legend.

titlefont. Optional.
Block font for the legend header.

font. Optional.
Block font for the normal text.

frame. Optional.
Block frame.

swidth (dimen). Optional, default ....
Width of the color data.

Category legends

cols (number) [(number)]. Optional, default 1.
Number of columns with symbols and separation between columns.

nodata yes|no. Optional, default no. Category legends.
Remove category no data.

order (number,number,...)'. Optional.
Reorder.

Gradient legends

height (dimen) or width (dimen).
Dimension of the frame with the legend.

vertical yes|no. Optional, default no.
Orientation of the gradient legend.

range. Optional.
Manual set of the data range for legend.

gradient yes|no. Optional.
Forze draw gradient legend with category data.

tick (dimen). Optional.
Length of the ticks.

whiteframe (dimen). Optional.
Width of the white frame around the bar color.

vlegend