(* VERSION 0002 *) module plot6; (*..................................................................*) (* PLOTLIB *) (* Plotlib is a collection of plot routines to aid in graphics *) (* programs. The routines were originally published in BYTE as *) (* 'Drawing with UCSD Pascal and the Hiplot Plotter' by Dr. James *) (* Stork, Oct 1981. The routines have been modified to run with *) (* a MicroAngelo graphics terminal by Ray Hopkins, 8 Chestnut Hill *) (* Ct., Cinnaminson N.J. (609) 829-4686. *) (*..................................................................*) type {$I PLOTLIB.TYP} const {$I PLOTLIB.CON} var xpos,ypos :external real; (*$IPLOTLIB.DEF*) {$ISTDLIB.DEF} external procedure plotsymbol(sym:integer;height:real); procedure plotarray(nopoints,freq,sym:integer; px,py,xmin,xmax,ymin,ymax,height,xlen,ylen:real; x,y: coord); var pen,i:integer; begin if nopoints>250 then begin outp($88); write('too many points'); readln; outp($88); exit; end; if (py+ylen>7) or (px+xlen>10) then begin outp($88); write('data is off screen. Type ret'); readln; outp($88); exit; end; xlen:=(xmax-xmin)/xlen; ylen:=(ymax-ymin)/ylen; if freq<0 then pen:=1 else pen:=2; freq:=abs(freq); plotline(1,((x[1]-xmin)/xlen)+px,((y[1]-ymin)/ylen)+py); for i:=2 to nopoints do begin plotline(pen,((x[i]-xmin)/xlen)+px,((y[i]-ymin)/ylen)+py); if freq>0 then if ((i+1)mod freq=0) then plotsymbol(sym,height); end; end; {plotarray} modend.