GLE Example: web.gle

[PDF file]

 


size 20 20
set font pldr
nbdata = 6 
sz = 6
scl = 100
ang = 360/nbdata

sub ppx pang pdist
	zzr = ang*(pang-1)*pi/180
	return cos(zzr)*sz*pdist/scl
end sub
sub ppy pang pdist
	zzr = ang*(pang-1)*pi/180
	return sin(zzr)*sz*pdist/scl
end sub

sub doweb fle$  fl$ ls lw
begin origin
	begin path fill fl$ stroke
	fopen fle$ inchan read
	fread inchan x
	j = 1
	amove ppx(j,x) ppy(j,x)
	until feof(inchan)
		j = j+1
		fread inchan  x
		aline ppx(j,x) ppy(j,x)
	next
	set lstyle ls lwidth lw color black
	closepath
	end path
end origin
end sub

sub dospikes 
  begin origin
	for pnt = 1 to nbdata
		amove 0 0
		aline ppx(pnt,100)  ppy(pnt,100)
	next pnt
  end origin
end sub

sub dolabel pnt t$
begin origin
	zz = ang*(pnt-1)
	amove ppx(pnt,100)*1.1 ppy(pnt,100)*1.1
	set just left
	if (zz>90) and (zz<270) then
		set just right
	end if
	write t$
end origin
end sub


! The order of the following sections determines what 
! is 'on top' of what.
amove 10 10
!      datafile   color  lstyle  lwidth 
@doweb "web.dat"  "clear" 2       .04
@doweb "web2.dat" "green" 5       .01


! Label the axes 
set hei .6
@dolabel 1 "Age"
@dolabel 2 "Weight"
@dolabel 3 "Height"
@dolabel 4 "Size"
@dolabel 5 "Color"
@dolabel 6 "Name"

! Circles at 25, 50, 75, 100
set lwidth 0
for i = 25 to 100 step 25
	set lstyle 2
	circle i*sz/scl
next i

! Spikes at all 6 points
@dospikes

 

[Return to examples page]