3

I'm trying to put as the title of a plot "P@10" using GnuPlot, using the Helvetica font.

What I did was this:

set encoding iso_8859_1

set title "P \100 10"

The \100 comes from the octal representation of the at symbol in unicode. The final plot, however, replaces the @ with a simple space. Other symbols work as expected.

I also tried the matlab script provided here, to look for the @ symbol in at least 4000 different codes, but I couldn't find it.

Is this possible, even with another font?

EDIT: I tried this on three different systems, Ubuntu AND Windows, to no avail..

EDIT2: Minimal working example:

set term postscript eps enhanced color

set encoding iso_8859_1

set title "Test \@ Test" -or- set title "Test \100 Test"

set out "example.eps"

plot sin(x)

My output doesn't have any @ sign in the title.

Svalorzen
  • 5,353
  • 3
  • 30
  • 54

1 Answers1

4

This post may be helpful. If you are using an 'enhanced' terminal you have to escape ('\@') the @ symbol.

Community
  • 1
  • 1
andyras
  • 15,542
  • 6
  • 55
  • 77
  • This is almost certainly the culprit. `@` is a meta-character in enhanced mode. (`help enhanced`) should provide more details. – mgilson Nov 29 '12 at 20:13
  • I already tried, instead of putting the octal code, to simply write the at symbol excaped, but the effect was the same. – Svalorzen Nov 30 '12 at 02:08
  • 1
    Thanks for posting the example code. I think the problem may now be your quotes. Try `set title "Test \\@ Test"` or `set title 'Test \@ Test'`. Those work for me. With single quotes '\@' escapes the @ symbol, while with double quotes you have to escape the backslash itself in order for it to escape the '@'. This is because of how gnuplot processes quoted strings. In double-quoted strings escapes are interpreted by gnuplot before being sent to the terminal driver (as I understand it), while single quotes are ordinary literal strings to gnuplot. `help syntax quotes` for more details. – andyras Nov 30 '12 at 14:04