program plot_with_auto_range integer pgopen real x(101),y(101),xold(101),yold(101) if( pgopen('/xwin') <= 0 ) stop xini = -5.0 dx = 10.0/100 do i=1,101 x(i)= xini + (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)