In this section:
In our first example we create a window and draw a quadratic curve within it.
c--Simple1.for
WINAPP
INTEGER N,winio@,i
PARAMETER(N=11)
REAL*8 x(N),y(N)
c--Create the data to be plotted.
DO i=1,N
x(i)=i-1
y(i)=x(i)**2
ENDDO
c--Plot the data.
i=winio@('%ca[SIMPLEPLOT-Quadratic]%bg[grey]&')
i=winio@('%pl[x_array]&',400,250,N,x,y)
i=winio@('%ff%nl%cn%tt[OK]')
END
%pl (SIMPLEPLOT Graphics Region) is like %gr (Graphics Region) and takes the basic form:
winio@('%pl[options]',width,height)
width and height represent the pixel dimensions of a SIMPLEPLOT graphics region within the window. Some of the options take additional arguments. In this example, the option called x_array takes three arguments namely the number of points N followed by an array of x co-ordinates and an array of y co-ordinates.
Following the usual ClearWin+ convention, all real data is passed as DOUBLE PRECISION values. However, SIMPLEPLOT uses single precision, so data values should not exceed the single precision range.