Silverfrost Logo About Us | Contact Us
 

Plotting y = f(x)

The following code is extracted from program simdem09 in the Simdem package, and it illustrates how easy it is to plot a curve in the form y = f(x), where x and y are double precision arrays.


c
c Define line and symbol types then number of points and data
c      
      l = 1  !solid line type
      m = 5  !circle symbol type
      n = 10 !plot 10 points
      do i = 1, n
         x(i) = i
         y(i) = i
      enddo 
c
c Define title and legends
c      
      ptitle = 'y = f(x)'
      xtitle = 'x'
      ytitle = 'y'       
c
c Plot the graph
c      
      call gks001 (l, m, n, x, y, ptitle, xtitle, ytitle)
 

The following plot is then displayed and can be edited to add further features, printed, or archived as a graphics file.

 

 

Copyright © 1999-2017 Silverfrost Limited