Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Unknown macro: {alias}

Name

psc — PostScript plotting

Syntax

psc lwf | slwf | on | off | open | close | scp | fontsize | vie | align | status | prot | col | font | fill | rec | stroke | expand | talign | txt | axes | curtxt | pos | line | chf | utmgrid | moveto | lineto | win | devcm2user | arc | ssc | bmp | jpeg | cross | newline | clip | linestyle | linewidth | outline | dash | overprint | ticml | pattern

Description

PostScript plotting, settings and commands.

The plotting system in Geocap called dplot is applying these commands to plot maps with a high carthographic standard.

PostScript is a state system which means that a specific setting is valid until a new setting is applied.

Note that it is possible to use psc com to write native PostScript commands. Check the PostScript Language Reference Manual (third edition).

Arguments

lwf line_width_factor

Unknown macro: {indent}

Set the line_width_factor of a postscript pen.

slwf line_width_factor

Unknown macro: {indent}

Set line_width_factor for shift lines in contouring.

open file_name

Unknown macro: {indent}

Open the file_name for writing postscript output.

close

Unknown macro: {indent}

Close the current output file for writing postscript output.

scp scale_in_meters_x scale_in_meters_y rel_portion_of_horizontal_margin_left rel_portion_of_vertical_margin_bottom

Unknown macro: {indent}

Scale plot, using the scale parameters for plot in x and y direction and the relative portion of the margins.

fontsize fontsize [cm]

Unknown macro: {indent}

Set the fontsize in user coordinates or in cm.

vie x_lower_left y_lower_left x_upper_right y_upper_right [cm]

Unknown macro: {indent}

Set viewport area, either in relative coordinates or in cm.

align [top | bottom | left | right | center]

Unknown macro: {indent}

Set graphics alignment.

status

Unknown macro: {indent}

Will write out the status of postscript in the message window.

prot [reset] | x_position y_position rotation_angle [cm]

Unknown macro: {indent}

Set rotation of plot in user or cm coordinates.

col red blu gre

Unknown macro: {indent}

Display the postscript line in rgb values red blu gre. Observe that the standard col command will also affect postscript when active.

font font_number

Unknown macro: {indent}

Will set the font with the given font_number.

fill

Unknown macro: {indent}

Will issue the postscript fill command in the output file.

stroke

Unknown macro: {indent}

Will issue the postscript stroke command in the output file.

rec x_lower_left y_lower_left x_upper_right y_upper_right

Unknown macro: {indent}

Will draw a rectangle according to the parameter input.

expand hor | ver | inside | outside | cover

Unknown macro: {indent}

Will expand the plot inside the viewport according to the argument.

Unknown macro: {indent}

Scale to match width of window/viewport

hor: scale_y = scale_x.
ver: scale_x = scale_y.
inside: shortest of scale_x or scale_y.
outside: longest of scale_x or scale_y.
cover: scale to viewport exactly.

txt text

Unknown macro: {indent}

Display text in the plot using the active font and font size.

curtxt curve_text [size size] [rot rot_angle] [use] [bsp] [palign align_x align_y]

Unknown macro: {indent}

Display curve_text by following the curve in active data using the active font and font size.
use: use the curve as it is. bsp: b-spline the curve. palign: position aligning the text according to align_x align_y.
If these parameters are set to 0 the text will be placed on the line.

axes n | e | w | s [incrx | incry | factorx | factory | offsetx | offsety]

Unknown macro: {indent}

Display axes for side: north | east | west | south. Specify increment, factor and offset.

talign x_position y_position

Unknown macro: {indent}

Set graphics alignment of text.

ticml tic_mark_length

Unknown macro: {indent}

Specify tic mark length for axes of size tic_mark_length.

pos x_position y_position cm

Unknown macro: {indent}

Set current position. Possibly translate from user to cm.

line x_start y_start x_stop y_stop

Unknown macro: {indent}

Will draw a line from start to stop.

chf crosshair_factor

Unknown macro: {indent}

Factor of the small cross lines in geographical grid.

utmgrid delta_x delta_y cross_size

Unknown macro: {indent}

Plotting of utmgrid or current projection.

moveto x_start y_start

Unknown macro: {indent}

Will move the pen to the start position.

lineto x_stop y_stop

Unknown macro: {indent}

Will draw the pen to the stop position.

win x_lower_left y_lower_left x_upper_right y_upper_right [aoi]

Unknown macro: {indent}

Set plot window area in world coordinates. aoi means set this as area of interest.

devcm2user

Unknown macro: {indent}

Will return to a Tcl variable the factor between cm and user coordinates.

user2devcm

Unknown macro: {indent}

Will return to a Tcl variable the factor between user and cm coordinates.

arc x_center y_center radius start_angle stop_angle

Unknown macro: {indent}

Will draw an arc according to the parameters specified.

ssc

Unknown macro: {indent}

Will set the area of interest to match the bounding box of active data.

bmp | jpeg | jpg file_name | use

Unknown macro: {indent}

Display a bit map of specified format from a file_name or use the current graphics on the screen.

cross x_center y_center size

Unknown macro: {indent}

Will draw a cross at x_center y_center with the total size in x and y directions.

newline

Unknown macro: {indent}

Issue a new text line equivalent to 1.2 times the fontsize.

clip x_lower_left y_lower_left x_upper_right y_upper_right

Unknown macro: {indent}

Clip out an area of the plot in user coordinates.

linestype line_style

Unknown macro: {indent}

Will set the line style, use 0,1 or 2. Ref. PostScript Language Reference Manual (third edition) p.673-674, setlinecap.

linewidth line_width

Unknown macro: {indent}

Will set the line with size. To be used in pattern specifications.

outline on | off

Unknown macro: {indent}

Will set outline of text on | off.

overprint on | off

Unknown macro: {indent}

Will set overprint of graphics on | off.

dash dash1 space1 dash2 space2 etc...

Unknown macro: {indent}

Will set line plotting in dash mode according to the dash pattern. Ref. PostScript Language Reference Manual (third edition) p.666.

pattern open x_size y_size

Unknown macro: {indent}

Open a pattern of size x_size y_size.
The postscript commands making up the pattern should be coded hereafter.

pattern close name [rotation]

Unknown macro: {indent}

Close the active pattern and name it name. Optionally use a rotation.

pattern name

Unknown macro: {indent}

Use pattern with name of pattern name.

Examples

Ex.1: Producing a postscript plot

psc format a4                               ;# specify format
win demo                                    ;# demo window: 450000 460000 6450000 6460000 1000 4000
psc open c:/users/olav/psfile.ps            ;# open output file
psc on                                      ;# set postscript on
psc vie 0.1 0.1 0.9 0.9                     ;# specify viewport in viewport coordinates
mak ran 11                                  ;# make 11 random points
grp 99 99                                   ;# grid surface 99 x 99 elements
sma i 250 can                               ;# spline map and annotate contours
psc off                                     ;# turn off postscript
sma i 250 sav                               ;# spline map and sav contours
psc on                                      ;# turn on postscript
mak glc                                     ;# get largest cell
col red                                     ;# set red color
pol                                         ;# draw the line
psc fontsize 1.5 cm                         ;# set font size
psc col .3 .2 .6                            ;# set color
psc curtxt "Largest contour" palign 0 0     ;# plot text to follow curve with no alignment
psc pos 450200 6461000                      ;# specify position
psc fontsize 2.8 cm                         ;# set font size
psc col .5 .9 .9                            ;# set color
psc txt "This is a text"                    ;# plot text
psc outline on                              ;# activate outline
psc lwf 2                                   ;# set line width factor
psc col 0 0 0                               ;# color black
psc txt "This is a text"                    ;# plot outline around text
psc outline off                             ;# outline feature off
psc lwf 1                                   ;# reset line width factor
col gre                                     ;# set green color
dra dwa                                     ;# dra data window area
psc fontsize 0.5 cm                         ;# set font size
psc ticml 0.15                              ;# set tic mark length (in cm)
psc axes ns incrx 2000 incry 2000           ;# draw axes in north and south
psc axes ew incrx 2000 incry 2000           ;# draw axes in east and west
psc close                                   ;# close postscript

The above example produces this image.


Simple postscript plot to demonstrate principles

Ex.2: Applying pattern in a postscript plot

psc format a4

psc open "C:/Users/Olav/test.ps"
psc on

rea block.pol
ssc
psc ssc

################## Make pattern
# norwegian flag
psc com 100 100 scale
psc pattern open 30 24
psc col 1 1 1
psc rec 0.1 0.1 22.1 16.1
psc fill
psc col 0.9372 0.1686 0.1765
psc rec 0.1 0.1 6.1 6.1
psc fill
psc rec 0.1 10 6.1 16.1
psc fill
psc rec 10 0.1 22.1 6.1
psc fill
psc rec 10 10 22.1 16.1
psc fill
psc col 0 0.1568 0.4078
psc rec 0.1 7.1 22.1 9.1
psc fill
psc rec 7.1 0.1 9.1 16.1
psc fill
psc pattern close Norway
psc com 0.01 0.01 scale
################## End pattern

# Save in workspace block
mhi block

psc pattern Norway ; # apply pattern
dis fill ; # display with fill option
psc pattern stop

mlo block
col 0 0 0
pol

psc close

The above example produces this image.


Demonstration of pattern

See also

pol - Polygon type display, map - Map display, sma - Spline map

Unknown macro: {pagebreak}
  • No labels