home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 8 / CDACTUAL8.iso / share / os2 / graficos / gle / web.gle < prev    next >
Encoding:
Text File  |  1994-01-12  |  1.5 KB  |  88 lines

  1. size 20 20
  2. set font pldr
  3. ndata = 6 
  4. sz = 6
  5. scl = 100
  6. ang = 360/ndata
  7.  
  8. sub ppx pang pdist
  9.     zzr = ang*(pang-1)*pi/180
  10.     return cos(zzr)*sz*pdist/scl
  11. end sub
  12. sub ppy pang pdist
  13.     zzr = ang*(pang-1)*pi/180
  14.     return sin(zzr)*sz*pdist/scl
  15. end sub
  16.  
  17. sub doweb fle$  fl$ ls lw
  18. begin origin
  19.     if fl$="clear" then
  20.         begin path stroke
  21.     else
  22.         begin path fill fl$  stroke
  23.     end if 
  24.     fopen fle$ inchan read
  25.     fread inchan x
  26.     j = 1
  27.     amove ppx(j,x) ppy(j,x)
  28.     until feof(inchan)
  29.         j = j+1
  30.         fread inchan  x
  31.         aline ppx(j,x) ppy(j,x)
  32.     next
  33.     set lstyle ls lwidth lw color black
  34.     closepath
  35.     end path
  36. end origin
  37. end sub
  38.  
  39. sub dospikes 
  40.   begin origin
  41.     for pnt = 1 to ndata
  42.         amove 0 0
  43.         aline ppx(pnt,100)  ppy(pnt,100)
  44.     next pnt
  45.   end origin
  46. end sub
  47.  
  48. sub dolabel pnt t$
  49. begin origin
  50.     zz = ang*(pnt-1)
  51.     amove ppx(pnt,100)*1.1 ppy(pnt,100)*1.1
  52.     set just left
  53.     if (zz>90).and.(zz<270) then
  54.         set just right
  55.     end if
  56.     write t$
  57. end origin
  58. end sub
  59.  
  60.  
  61. ! The order of the following sections determines what 
  62. ! is 'on top' of what.
  63. amove 10 10
  64. !      datafile   color  lstyle  lwidth 
  65. @doweb "web.dat"  "clear" 2       .04
  66. @doweb "web2.dat" "green" 5       .01
  67.  
  68.  
  69. ! Label the axes 
  70. set hei .6
  71. @dolabel 1 "Age"
  72. @dolabel 2 "Weight"
  73. @dolabel 3 "Height"
  74. @dolabel 4 "Size"
  75. @dolabel 5 "Color"
  76. @dolabel 6 "Name"
  77.  
  78. ! Circles at 25, 50, 75, 100
  79. set lwidth 0
  80. for i = 25 to 100 step 25
  81.     set lstyle 2
  82.     circle i*sz/scl
  83. next i
  84.  
  85. ! Spikes at all 6 points
  86. @dospikes
  87.                                         
  88.