program plot_with_auto_range integer pgopen real x(101),y(101) if( pgopen('/xwin') <= 0 ) stop dx = 10.0/100 do i=1,101 x(i)= -5.0 + (i-1)*dx c y(i)= x(i)**2 y(i)= sin(x(i)) end do xmin=x(1) xmax=x(1) ymin=y(1) ymax=y(1) do i=2,101 if(x(i)>xmax)xmax=x(i) if(x(i)ymax)ymax=y(i) if(y(i)