      character*64 name
      character*1 quote
      character*3 eol
      quote = char(39)
      eol(1:1) = quote
      eol(2:2) = char(44)
      eol(3:3) = char(92)

      write (*,'(a)') 'set data style linespoints'
      write (*,'(a)') 'set logscale xy'
      write (*,'(a)') 'set xlabel "TRIAD MFLOPS"'
      write (*,'(a)') 'set ylabel "Balance"'
      write (*,'(a)') 'set title "Balance vs. STREAM MFLOPS"'
      write (*,'(a)') 'set nokey'
      write (*,'(a)') 'set notime'
      write (*,'(a)') 'set terminal pbm medium color'
      write (*,'(a)') 'set output ''out.pbm'' '
      write (*,'(a)') 'plot [10:100000] [0.5:200] \\'
    1 read (*,'(a)',end=8888) name
      write (*,'(a1,a,a3)') quote,name(1:length(name)),eol
      goto 1
 8888 write (*,'(a)') '0'
      write (*,'(a)') 'set terminal postscript color "Helvetica" 18'
      write (*,'(a)') 'set output ''out.ps'' '
      write (*,'(a)') 'replot'
      end

	integer function length(string)
	character*(*) string

	do 100 j=LEN(string),1,-1
	    if (string(j:j).ne.' ') then
		length = j
		return
	    endif
  100	continue
	length = 0
	return
	end
