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 10 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

slwf line_width_factor

open file_name

close

scp scale_in_meters_x scale_in_meters_y rel_portion_of_horizontal_margin_left rel_portion_of_vertical_margin_bottom

fontsize fontsize [cm]

vie x_lower_left y_lower_left x_upper_right y_upper_right [cm]

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

status

prot [reset] | x_position y_position rotation_angle [cm]

col red blu gre

font font_number

fill

stroke

rec x_lower_left y_lower_left x_upper_right y_upper_right

expand hor | ver | inside | outside | cover

txt text

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

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

talign x_position y_position

ticml tic_mark_length

pos x_position y_position cm

line x_start y_start x_stop y_stop

chf crosshair_factor

utmgrid delta_x delta_y cross_size

moveto x_start y_start

lineto x_stop y_stop

win x_lower_left y_lower_left x_upper_right y_upper_right [aoi]

devcm2user

user2devcm

arc x_center y_center radius start_angle stop_angle

ssc

bmp | jpeg | jpg file_name | use

cross x_center y_center size

newline

clip x_lower_left y_lower_left x_upper_right y_upper_right

linestype line_style

linewidth line_width

outline on | off

overprint on | off

dash dash1 space1 dash2 space2 etc...

pattern open x_size y_size

pattern close name [rotation]

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

  • No labels