include define POINT 1 define PLUS 2 define LINE 3 define MSIZE 4 # SPPLOT -- Plot data procedure spplot(gp, gt, xdata, ydata, ndata, type ) pointer gp # i: gio pointer pointer gt # i: gtools pointer double xdata[ARB] # i: x data points double ydata[ARB] # i: y data points int ndata # i: number of data points int type # i: type of plot (points, pluses or line) pointer sp, xd, yd int i begin # Allocate memory call smark(sp) call salloc( xd, ndata, TY_REAL ) call salloc( yd, ndata, TY_REAL ) # Copy data into single precison arrays for (i=1; i<=ndata; i=i+1){ Memr[xd+i-1] = xdata[i] Memr[yd+i-1] = ydata[i] } # Set the appropriate mark or line type switch (type) { case POINT: # Plot points call gt_sets( gt, GTTYPE, "mark") call gt_sets( gt, GTMARK, "point" ) case PLUS: # Plot plus call gt_sets( gt, GTTYPE, "mark") call gt_sets( gt, GTMARK, "plus" ) call gt_seti( gt, GTXSIZE, MSIZE ) call gt_seti( gt, GTYSIZE, MSIZE ) case LINE: # Plot a line call gt_sets( gt, GTTYPE, "line" ) } # Plot the data call gt_plot( gp, gt, Memr[xd], Memr[yd], ndata ) call sfree(sp) end