Skip to ContentSkip to Navigation
Society/business Center for Information Technology Research and Innovation Support Virtual Reality and Visualisation

Color Postscript demonstration


       program ps_kom

c This program demonstrates:
c - the use of colors
c - special PS routines for PostScript (PS_...)
c - PostScript fonts
c - formula with subscripts
c - Greek characters

       dimension x(10), y(10)


c PostScript font definition:
       call FONT_SWITCH_CHARACTER ('$')
c associate font 'Albertus' with 'B'
       call PS_DEFINE_FONT('B','Albertus')
c default font A = 'Times-Roman'
       call PS_DEFINE_FONT('A','Times-Roman')
       call PS_DEFINE_FONT('C','Symbol')

c back ground, GREEN 
       call PS_BACKGROUND(3.0)

c gridlines
       call GRIDLINES(1,1)
c gridlines linewidth in cm, gray value (lw, gv):
       call PS_GRID_ATTRIBUTES(0.04, 2.0)
c suppress ticks:
       call SUPPRESS_TICKS(1,1)
c suppress axis line:
       call SUPPRESS_AXISLINES(1,1)

       call CLIP_AT_AXES(1)

c frame lw, gv
       call PS_FRAME_ATTRIBUTES(0.04, 2.0)

c Axis labels  end title in font 'Albertus'
c The axisnumbers iof a linear axis are plotted after the label, so the axisnumbers 
c are in font A (Times-Roman).
c (Axisnumbers and label of logarithmix axis must have same font Times Roman)

       call FRAME(10.,0.,10.,10.,0.,10.,
     + '$BXlab$A','$BYlab$A','$BColor with PostScript$A')

c line 1
       do 10 i=1, 10
10        y(i)=.1*i*i
c graph lw, RED 
       call PS_GRAPH_ATTRIBUTES(.2,2.0)
       call POLYLINE(' ',10,x,y)

c line 2
       do 20 i=1, 10
20        y(i)=.1*i*i+1.0
c graph lw, RED 
       call PS_GRAPH_ATTRIBUTES(.1,2.0)
c line style
       call LINE_STYLE_NR(2)
       call POLYLINE(' ',10,x,y)

c BLUE  rectangle, used as blanked-out area:
       x(1) = 1.
       y(1) = 1.
       x(2) = 6.
       y(2) = 1.
       x(3) = 6.
       y(3) = 4.
       x(4) = 1.
       y(4) = 4.
       call PS_GRAPH_ATTRIBUTES(0.02, 4.)
       call PS_FILL_AREA(' ', 4,x,y)

c define GREEN text:
       call PS_GRAPH_ATTRIBUTES(0.02,3.)

c formula with subscripts (Times-Roman)
       call GSTRNG(2.,3.,-.4,0.,'C')
       call GSTRNG(999.,2.9,-.3,0.,'2')
       call GSTRNG(999.,3.,-.4,0.,'H')
       call GSTRNG(999.,2.9,-.3,0.,'5')

c Greek characters:
       call GSTRNG(2.,2.,-.3,0.,'$Ca$A = 1.0 , $CF$A = 2.0')

c make PostScript file + preview with xv
c     call KOMPLOT(40,'')
c     call system('xv')


Last modified:02 October 2015 8.22 p.m.