program graph1 implicit none call init call viewport(0.2,0.2,0.8,0.8) call xyworld(-1.2,-1.2,1.2,1.2) call frame call drawline call fin stop end subroutine frame implicit none integer n,i real(4) x,y,dx,dy call setgray(0.2) call arrow(-1.1,0.0,1.1,0.0,0.02) call arrow(0.0,-1.1,0.0,1.1,0.02) call textx(1.15,0.03,'x') call texty(0.02,1.15,'y') call textx(-0.13,-0.0,'O') call textx(0.5,-0.0,'pi/2') call textx(1.0,-0.0,'pi') call textx(-0.5,-0.0,'-pi/2') call textx(-1.0,-0.0,'-pi') call texty(0.02,1.0,'1') call texty(0.02,0.5,'0.5') call texty(0.02,-0.5,'-0.5') call texty(0.02,-1.0,'-1') n=10 do i=1,n x=0.1*real(i) if(i/5*5==i)then dy=0.02 else dy=0.01 end if call line(-x,-dy,-x,dy) call line(x,-dy,x,dy) end do do i=1,n y=0.1*real(i) if(i/5*5==i)then dx=0.02 else dx=0.01 end if call line(-dx,-y,dx,-y) call line(-dx,y,dx,y) end do return end subroutine drawline implicit none integer i integer,parameter::nx=100 real(4) x,y,t x=-1.0 y=0.0 call linewidth(1.5) call setgray(0.0) call plot(x,y,3) do i=-nx+1,nx t=real(i)/real(nx) x=t y=sin(t*3.14159) call plot(x,y,2) end do call stroke return end