Plus/minus symbol in gnuplot?
Asked Answered
L

2

6

I'm generating .eps figures in gnuplot for inclusion into papers typeset with LaTeX, using

set terminal postscript eps enhanced "Helvetica" 14

This generally works perfectly, but i'm now trying to put together a figure using a label that includes a ± symbol. If I use it directly, e.g.

set label "-56±2"

then it appears correctly on the default 'wxt' terminal but is prefixed by an A with a circumflex (i.e. -56±2) in the postscript output. Using

set label "-56^+/-2" 

works but looks rubbish. In the past i've used the 'Angstrom' character (Å) by doing

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

but I haven't managed to get this to work either for the unicode representation of ± which I think is \261 (see http://www.fileformat.info/info/unicode/char/00b1/index.htm), i.e.

set label "-56 \261 2" 

but I just get an empty space between the -56 and 2. Any ideas on how to do this? Ubuntu 10.10 and Gnuplot 4.4 patchlevel 0, if it's important.

Lodi answered 30/7, 2011 at 17:5 Comment(0)
L
6

Just for the record, from the Gnuplot perspective the correct answer does appear to be this:

set encoding iso_8859_1 
set label "-56 \261 2" 

which gives a label

-56 ± 2

It works perfectly on a different machine (same Gnuplot level) so i'm not sure why there's an issue on the original Ubuntu machine; both machines display the resultant .eps file correctly.

Lodi answered 1/8, 2011 at 4:54 Comment(0)
S
1

To get a more beautiful label, I suggest epslatex terminal. It produces graph part in eps format and text part in latex format. Then you can edit your tex file and inset any special characters latex support.

Spicate answered 8/9, 2011 at 2:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.