# Greek symbols in plot labels

8 messages
Open this post in threaded view
|

## Greek symbols in plot labels

 Hi - I am trying to add a label to a plot and the label is comprised of both standard characters and Greek characters, for instance, "Frequency between 0 and 2"  Of course, I want to use the actual character for pi in the label.  This should be doable by setting my terminal type to an enhanced type and issuing the command xlabel('Frequency between 0 and 2{/Symbol p}'); However, when I do this, the entire label is displayed in Greek characters and hence makes no real sense.  When I issue the command a second time from the terminal it works.  But when I try issuing the command twice in a script it doesn't work.  Is there something more I need to do?  I know that technically this would be considered a gnuplot question but it doesn't give problems in gnuplot leading me to believe that the issue is somewhere in Octave-gnuplot interaction. Thanks -Ron _______________________________________________ Help-octave mailing list [hidden email] https://www.cae.wisc.edu/mailman/listinfo/help-octave
Open this post in threaded view
|

## Re: Greek symbols in plot labels

 On 6/19/06, Ron Crummett <[hidden email]> wrote: > Hi - > > I am trying to add a label to a plot and the label is comprised of both > standard characters and Greek characters, for instance, "Frequency > between 0 and 2"  Of course, I want to use the actual character for > pi in the label.  This should be doable by setting my terminal type to > an enhanced type and issuing the command > > xlabel('Frequency between 0 and 2{/Symbol p}'); > > However, when I do this, the entire label is displayed in Greek > characters and hence makes no real sense.  When I issue the command a > second time from the terminal it works.  But when I try issuing the > command twice in a script it doesn't work.  Is there something more I > need to do?  I know that technically this would be considered a gnuplot > question but it doesn't give problems in gnuplot leading me to believe > that the issue is somewhere in Octave-gnuplot interaction. > Using octave  2.9.5 (Fedora Core 5) the following seems to work fine: octave:1> s=randn(10); octave:2> xlabel('Frequency between 0 and 2{/Symbol p}'); octave:3> plot(s) octave:4> print("testps.ps", "-dpsc2") (I can send you the output file privately.) So, tell us in more details about your configuration and the command sequence you use for plots. If your octave is rather old, make sure you have set automatic_replot to 0. > Thanks > > -Ron Sincerely, Dmitri. -- _______________________________________________ Help-octave mailing list [hidden email] https://www.cae.wisc.edu/mailman/listinfo/help-octave
Open this post in threaded view
|

## Re: Greek symbols in plot labels

 In reply to this post by Ron Crummett On 6/19/06, Ron Crummett <[hidden email]> wrote: > I am trying to add a label to a plot and the label is comprised of both > standard characters and Greek characters, An alternate solution, if this is an .eps file you want to include with a LaTeX document, is to use something like the LaTeX psfrag package for labelling  your graphs. It's relatively easy. You put dummy labels with Octave and then use psfrag to put the real labels into the finished TeX. This has the added benefit that all fonts in your figures correspond perfectly to fonts in your TeX file. - Jordi G. H. _______________________________________________ Help-octave mailing list [hidden email] https://www.cae.wisc.edu/mailman/listinfo/help-octave
Open this post in threaded view
|

## Re: Greek symbols in plot labels

 On 20-Jun-2006, Jordi Gutierrez Hermoso wrote: | On 6/19/06, Ron Crummett <[hidden email]> wrote: | > I am trying to add a label to a plot and the label is comprised of both | > standard characters and Greek characters, | | An alternate solution, if this is an .eps file you want to include | with a LaTeX document, is to use something like the LaTeX psfrag | package for labelling  your graphs. It's relatively easy. You put | dummy labels with Octave and then use psfrag to put the real labels | into the finished TeX. This has the added benefit that all fonts in | your figures correspond perfectly to fonts in your TeX file. Does that work with PDF files too? I prefer the epslatex terminal.  You can convert the PS part to PDF and the TeX part which contains the labels is processed by TeX, so can contain any TeX fonts/symbols/whatever. jwe _______________________________________________ Help-octave mailing list [hidden email] https://www.cae.wisc.edu/mailman/listinfo/help-octave
Open this post in threaded view
|

## Re: Greek symbols in plot labels

 On 6/20/06, John W. Eaton <[hidden email]> wrote: > | An alternate solution, if this is an .eps file you want to include > | with a LaTeX document, is to use something like the LaTeX psfrag > | package for labelling  your graphs. It's relatively easy. You put > | dummy labels with Octave and then use psfrag to put the real labels > | into the finished TeX. This has the added benefit that all fonts in > | your figures correspond perfectly to fonts in your TeX file. > > Does that work with PDF files too? Sort of... You can create a .ps file and then run ps2pdf to generate a pdf file from that. I usually automate this process by writing a very simple-minded makefile, so that I can compile the TeX as I'm editting in Emacs. On occasions, I've seen this messes up some fonts slightly in the pdf for mysterious reasons. Sometimes it happens, and sometimes it doesn't. I'm mystified. > I prefer the epslatex terminal.  You can convert the PS part to PDF > and the TeX part which contains the labels is processed by TeX, so can > contain any TeX fonts/symbols/whatever. Never tried that. I'll look into it. Thanks for the suggestion! - Jordi G. H. _______________________________________________ Help-octave mailing list [hidden email] https://www.cae.wisc.edu/mailman/listinfo/help-octave
Open this post in threaded view
|

## Re: Greek symbols in plot labels

 In reply to this post by Ron Crummett Ron Crummett wrote Hi - I am trying to add a label to a plot and the label is comprised of both standard characters and Greek characters, for instance, "Frequency between 0 and 2"  Of course, I want to use the actual character for pi in the label.  This should be doable by setting my terminal type to an enhanced type and issuing the command xlabel('Frequency between 0 and 2{/Symbol p}'); However, when I do this, the entire label is displayed in Greek characters and hence makes no real sense.  When I issue the command a second time from the terminal it works.  But when I try issuing the command twice in a script it doesn't work.  Is there something more I need to do?  I know that technically this would be considered a gnuplot question but it doesn't give problems in gnuplot leading me to believe that the issue is somewhere in Octave-gnuplot interaction. Thanks -Ron _______________________________________________ Help-octave mailing list [hidden email]https://www.cae.wisc.edu/mailman/listinfo/help-octave To avoid having the entire label in Greek, you can use the \ character, like this: xlabel('Saving rate \gamma') This only converts gamma to the real character. However, sometimes it doesn't recognize some characters. I keep having issues with ro...