  % Title "Graph"
 '% Animated
  % ScaleUp
 '% PlaceCentral
 '% AnchorCentral

  uses glo2\GraphUtil


  sub main
  ========
  static sys   imgn,res,wi,ht
  cls

  pushstate 'FOR GRAPH
  '
  static MoveableObject gr
  if not gr.id
    gr.mode=0x111
    gr.snap=.1
    gr.set 100, 0, 5, -16, 0
  end if
  gr.act
  TouchZone
  'color     0.0, 0.8, 0.8, 1
  linescale  20.0, 1.0,  .3, 5 'X AXIS
  rotateZ  90
  linescale  10.0, 1.0, -.3, 5 'Y AXIS
  rotateZ -90
  'X AXIS VALUES
  color .5,1
  pushstate
  move 0,-1.5
  numscale 0,0,10,0,  0,10,2,1,  3
  popstate
  'Y AXIS VALUES
  color .99,.50
  pushstate
  move -3
  numscale 0,0,0,5,  500,500,3,0,  3
  popstate
  'PLOTS
  float d={ 0,1, 5,2, 10,5, 20,9 } : sys n=countof(d)>>1
  '
  thickness 2 : color 1.,1.,.0  :     LinePlot  n,d
  thickness 3 : color .0,.5,.0  : VertLinePlot  n,d
  thickness 3 : color .0,.5,.0  : HorzLinePlot  n,d
 'move 0,0,.01
 'PointSize 9 : color 0,0,.5,1 : PointPlot n,d
 'move 0,0,-.01
 color .7,.5,.0  : VertBarPlot  n,d, 1.0
 'color .7,.5,.0  : HorzBarPlot  n,d, 1.0
  '
  popstate 'END OF GRAPH
  '
  pushstate
  static MoveableObject title
  if not title.id
    title.mode=0x111
    title.snap=.1
    title.set 200, 0, 2, -3, 0
  end if
  title.act 
  TouchZone .5
  scale 2
  printl "2D Graphs"
  popstate
  end sub 'main

  EndScript