From: rvenable@helix.nih.gov (Richard M. Venable)
Subject: postscript greek char kludge
Keywords: postscript greek math symbols
Reply-To: rvenable@helix.nih.gov (Richard M. Venable)
Organization: National Institutes of Health
Date: Thu, 8 Oct 1992 23:32:32 GMT

The following is a re-post of an earlier message from info-gnuplot.
I thought it was particularly useful and saved it, and offer it now
as a response to an article here asking about Greek characters in
Postscript output.  This is a bit of a "hack" that requires a little
knowledge of Postscript as a programming language.  

---------------- BEGIN ORIGINAL POSTING ------------------------

From: Roque Donizete de Oliveira <oliveria@engin.umich.edu>
Message-Id: <5a9be4b42.0038d97@ocher.engin.umich.edu>
To: bodzio@mirek.ai.polymtl.ca, pixar!info-gnuplot@sun.com
Subject: Re:  greek symbols in gnuplot
Status: R

>> I was wondering how to write labels and titles which include greek symbols.
>> I couldn't find any reference to it in the manual, except in case of the
>> latex driver. But I have no clue how to do it for the postscript driver.

I'm using gnuplot 3.2 with "set term postscript eps 14".

Until someone implements this feature (the ability
to easily mix postscript fonts, including subscripting
and superscripting) this I what I endep up doing,
with the help of a couple of people.

The example below shows what I did to get the postscript
equivalent of LaTeX's $f(v_{\parallel},v_{\perp})$, but you
can easily modify it to get whatever other symbols you want.
In gnuplot I asked for (with the postscript driver):

        set zlabel "f(vpar,vper)"


I then had to patch the postscript file:

1) First I increased the gnudict dictionary size, i.e.

   /gnudict 50 dict def

2) I then added the definitions for the symbols
   I wanted within the scope of the gnudict, i.e.,
   I put the symbols below just between "gnudict begin" 
   and "end" (just before %%EndPrologue).

   % Define a default font. We use 10 pt Times-Roman, scaled by 20 (to
compensate "0.050 0.050 scale" 
   % that appears below) 
   /defaultfont /Times-Roman findfont 200 scalefont def
   % Make "subscript" Symbol font for perpendicular symbol -- 7 point
high, moved down 3 points , scaled by 20
   /perfont     /Symbol findfont [140 0 0 140 0 -60] makefont def
   % Make a special font for the subscript "parallel" symbol -- we
   % drop this only by 2 point and use two "bar" characters to make
   % "parallel"... this is because bar goes below the base line. Scaled
by 20.
   /parfont     /Symbol findfont [120 0 0 120 0 -40] makefont def
   /vper {
           defaultfont setfont (v)    show
           perfont     setfont (\136) show
         } bind def
   
   /vpar {
           defaultfont setfont (v)        show
           parfont     setfont (\174\174) show
         } bind def
   
   /fvparvper {
                defaultfont setfont (f\(v)      show 
                parfont     setfont (\174\174)  show
                defaultfont setfont (,v)        show 
                perfont     setfont (\136)      show
                defaultfont setfont (\))        show 
              } bind def
   

3) I then modified the text in the postscript file, i.e.,
   I replaced the line
(f\(vpar,vper\)) Cshow
   by
fvparvper


Definitely this isn't an elegant (since it requires manual
modification of the postscript file) and best solution (there
are better ways of doing mixed font operations, in particular
the macros written by Martin Green in November 1990, which
I strongly recommend to anyone who wants to implement this
much needed feature in the postscript driver).  
This is how one would define the $f(v_{\parallel},v_{\perp})$ 
text using  Martin Green's macros:

 [{12 R} (f\(v) subs [{8 S} (\174\174)] (,v) subs [{8 S} (\136)] (\)) ]
display

where "12 R" is 12pt Times-Roman (these definition appear
in the package), "subs" stands for subsscript mode, "8 S"
changes to an 8pt Symbol font, and "display" is a macro
the parses everything and shows the result on the page.

Good luck.

   Roque

--------------------- END OF ORIGINAL POSTING ----------------------

Caveat: I haven't actually tried it.

	Rick Venable
	FDA Biophysics Lab
x-gateway: rodan.UU.NET from info-gnuplot to comp.graphics.gnuplot; Fri, 9 Oct 1992 11:43:39 EDT
Date: Fri, 9 Oct 1992 08:00:23 PDT
From: woo@ra-next.arc.nasa.gov (Alex Woo x6010 227-6 rm 315)
Subject: Reminder: Mailing List will be refreshed today
Newsgroups: comp.graphics.gnuplot