	subroutine plt7(mxlen,mxser,mxs,tmpf,tmpr,tmpi,tify,tn,nc,pith,mnpoff,flag,string)
c more pasta
	integer mxs,mxlen,mxser,nc,mnpoff
	integer tify(mxser),tn(mxser),pith(mxs) 
	real*4 flag
	real*4 tmpf(mxlen,mxser),tmpr(mxlen,mxser),tmpi(mxlen,mxser)
	character string*35
c
c local decs
	integer red,blue,green
	integer p,j,k
	real*4 minx,maxx,miny,maxy,step
	real*4 wrk1(5000),wrk2(5000)
	character ans*1,filename*9,dev*80
	logical ok,bg
c
       dev='Mac1';ok=.true.
       red=255;green=255;blue=255
       bg=.false.
c	write(*,'(/1x,''from plt6'')')
c
	miny=999.;maxy=-999.;minx=miny;maxx=maxy
	do p=1,nc
	  do j=1,tn(p)
		if(tmpr(p,j).gt.maxy)maxy=tmpr(p,j)
		if(tmpr(p,j).lt.miny)miny=tmpr(p,j)
	  enddo
	  if(tify(p).lt.int(minx))minx=real(tify(p))
	  if( ((tify(p)+tn(p))-1).gt.int(maxx))maxx=real( ((tify(p)+tn(p))-1) )
	  enddo
	enddo
c
10	if(ok)call plsdev(dev)
c
c set background color
c
      if(.not.bg)then
        call plscol0(0,255,255,255)              !change default color map black>white 
        call plscol0(15,0,0,0)                   !change default color map white>black
        call plscolbg(red,green,blue)            !change background color if other than white is desired
      elseif(bg)then
        call plscol0(15,255,255,255)             !change default color map white>black
        call plscol0(0,0,0,0)                    !change default color map black>white
        call plscolbg(red,green,blue)            !change background color if other than white is desired
      endif  
c	
c initialize plplot
	call plinit()
	call plssub(1,3)
c
c top plot
       call plwid(2)
	call plcol(15)   !color box and lables
	call plenv(minx,maxx,miny,maxy,0,20)
	call pllab('Year','Original Values',string)
	call plcol(1); call plwid(1)
       do p=1,nc
          k=1
          do j=1,tn(p)
             wrk1(k)=tmpr(j)
             wrk2(k)=real((ify(p)+j)-1)
             k=k+1
          enddo
	   call plline(k-1,wrk1,wrk2)
	enddo
c
c middle plot
	miny=999.;maxy=-999.;minx=miny;maxx=maxy
	do p=1,nc
	  do j=1,tn(p)
		if(tmpf(p,j).gt.maxy)maxy=tmpf(p,j)
		if(tmpf(p,j).lt.miny)miny=tmpf(p,j)
	  enddo
	enddo
       call plwid(2)
	call plcol(15)   !color box and lables
	call plenv(minx,maxx,miny,maxy,0,20)
	call pllab('Year','CurveFits',string)
	call plcol(1); call plwid(1)
       do p=1,nc
          k=1
          do j=1,tn(p)
             wrk1(k)=tmpf(j)
             wrk2(k)=real((ify(p)+j)-1)
             k=k+1
          enddo
	   call plline(k-1,wrk1,wrk2)
	enddo
c
c bottom plot
	miny=999.;maxy=-999.;minx=miny;maxx=maxy
	do p=1,nc
	  do j=1,tn(p)
		if(tmpi(p,j).gt.maxy)maxy=tmpi(p,j)
		if(tmpi(p,j).lt.miny)miny=tmpi(p,j)
	  enddo
	enddo
       call plwid(2)
	call plcol(15)   !color box and lables
	call plenv(minx,maxx,miny,maxy,0,20)
	call pllab('Year','Indices',string)
	call plcol(1); call plwid(1)
       do p=1,nc
          k=1
          do j=1,tn(p)
             wrk1(k)=tmpi(j)
             wrk2(k)=real((ify(p)+j)-1)
             k=k+1
          enddo
	   call plline(k-1,wrk1,wrk2)
	enddo
c	
20	call plend()	    	    
c	
       ans='C '
	dev='Mac1'
       write(*,'(/1x,''|************* plot options menu ***************|'')')
       write(*,'(1x,''|-----------------------------------------------|'')')
       write(*,'(1x,''|       [s]ave   <[c]ontinue>   [r]eplot        |'')') 
       write(*,'(1x,''|_______________________________________________|'')')
       write(*,'(/1x,'' enter option number > '',$)')
       read(*,'(a1)')ans
       if((ans.eq.'S').or.(ans.eq.'s'))then
         dev='psc';ok=.false.;filename='plt7.ps'
	  call plsdev(dev)
         call plsfnam(filename)
         goto 10
       elseif((ans.eq.'R').or.(ans.eq.'r'))then
         ok=.true.
         goto 10
       elseif((ans.eq.'C').or.(ans.eq.'c').or.(ans.eq.' ').or.
     *                             (ans.eq.'Y').or.(ans.eq.'y'))then
         return
	endif
c
	return
	end
c
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
