Angstroms symbol in Gnuplot

View: New views
5 Messages — Rating Filter:   Alert me  

Angstroms symbol in Gnuplot

by Trillianx :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I would like to have the Angstroms symbol in gnuplot. I found this website :

http://www.physics.umanitoba.ca/~gillis/gnuplot/gnuplot_postscript.html

clicking on "ps_guide.ps" and scrolling on Page 2 tells me the following:

T = text (here Times-Roman)    S = Symbol    Z = ZapfDingbats    E = ISO Latin-1 encoding

305  ¯  ⊕  ➅  Å

Now adding this like:

set xlabel "Wavelength ({/305})"

does not seem to work. How do I get it to work?

Would greatly appreciate your help!

Trillain

Re: Angstroms symbol in Gnuplot

by Thomas Sefzick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

page 2 tells you a little bit more:
> (the "E" character set is accessed via an option on "set encoding")
and 'latin-1' is also called 'iso_8859_1'

page 1 tells you:
'/' is used for setting fonts
'\' is used for octal codes

the commands you need are:

set encoding iso_8859_1
set xlabel "Wavelength (\305)"

Trillianx wrote:
I would like to have the Angstroms symbol in gnuplot. I found this website :

http://www.physics.umanitoba.ca/~gillis/gnuplot/gnuplot_postscript.html

clicking on "ps_guide.ps" and scrolling on Page 2 tells me the following:

T = text (here Times-Roman)    S = Symbol    Z = ZapfDingbats    E = ISO Latin-1 encoding

305  ¯  ⊕  ➅  Å

Now adding this like:

set xlabel "Wavelength ({/305})"

does not seem to work. How do I get it to work?

Would greatly appreciate your help!

Trillain

Re: Angstroms symbol in Gnuplot

by sgiani :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

... yap! but what if the term is png enhanced?
do I have maybe to have a special *.ttf in my GDFONTPATH?

Any suggestions? Thanks in advance, Sam

Thomas Sefzick wrote:
page 2 tells you a little bit more:
> (the "E" character set is accessed via an option on "set encoding")
and 'latin-1' is also called 'iso_8859_1'

page 1 tells you:
'/' is used for setting fonts
'\' is used for octal codes

the commands you need are:

set encoding iso_8859_1
set xlabel "Wavelength (\305)"

Re: Angstroms symbol in Gnuplot

by Thomas Sefzick () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

you don't need a special file.
define GDFONTPATH and then give the filename
(without extension) as font name when setting the
terminal to png.

an example:

i want to use luxi roman regular, the font file is there:

/usr/share/fonts/truetype/luxirr.ttf

in the shell i set:

export GDFONTPATH=/usr/share/fonts/truetype

and in gnuplot:

set encoding iso_8859_1
set xlabel 'Wavelength (\305)'
set term png enhanced font luxirr
set output 'test.png'
plot x
set output

sgiani wrote:
... yap! but what if the term is png enhanced?
do I have maybe to have a special *.ttf in my GDFONTPATH?

Re: Angstroms symbol in Gnuplot

by sgiani :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear Thomas,

thanks a lot for the suggestion, it pointed me towards the good direction, I am satisfied of the result but there is still something I can't understand.

First of all I would like to point out that in your example,
set xlabel 'Wavelength (\305)'
the "\305" should be between brackets "{\305}"

The rest of the problem, as much as I could deduce, lies probably in the type of font one uses: in facts I would like to use LaTeX font cmr10.ttf, and it seems iso_8859_1 encoding it is not totally supported.

I tried to experiment some of the characters listed on the standard (http://en.wikipedia.org/wiki/ISO_8859-1) within the
> set term png enhanced font "cmr10"
settings

For some amongs them I get the corresponding glyph (as they are called in the jergon ;-) ), but for others just an empty square box. I tried also the usual Symbol.ttf font but same story.

Hereafter i post a possible workaround, mixing the font that I desire for labels (cmr10.ttf) and another that allows me to display the Angstrom caracter \305 (luxirr.ttf):

> set term png enhanced font "cmr10"
> set xlabel 'Wavelength ({/luxirr.ttf \305})'

Greetings from Switzerland, the land of the constructive compromises! Sam


Thomas Sefzick wrote:
you don't need a special file.
define GDFONTPATH and then give the filename
(without extension) as font name when setting the
terminal to png.

an example:

i want to use luxi roman regular, the font file is there:

/usr/share/fonts/truetype/luxirr.ttf

in the shell i set:

export GDFONTPATH=/usr/share/fonts/truetype

and in gnuplot:

set encoding iso_8859_1
set xlabel 'Wavelength (\305)'
set term png enhanced font luxirr
set output 'test.png'
plot x
set output