program exam_pgplot implicit none integer pgopen, ngrids, i parameter (ngrids=1000) real x(ngrids), y(ngrids), delta_x, xmin, xmax xmin = -10.0 xmax = 10.0 if(pgopen('/xwin').le.0) stop call pgenv (xmin, xmax, -1.0, 1.0, 0, 0) delta_x = (xmax-xmin)/(ngrids-1) x(1) = xmin y(1) = sin(x(1)) * (1/ (1+(x(1)**2)) ) do i=1, ngrids-1 x(i+1) = x(i) + delta_x y(i+1) = sin(x(i+1)) * (1/ (1+(x(i+1)**2) )) end do call pgline(ngrids, x, y) call pgclos end