I have a gnuplot script, which has a key (legend), and I want the legend to include the plus or minus symbol.
I found that I could use \261 if I use "set encoding iso_8859_1" (see script, below) but it's a bit temperamental. I can only get it to work if I have an underscore somewhere before in the legend title. That is okay, because I want to use the subscript facility but I want all of "mag" to be subscripted. The way I have it at the moment, only the m is subscripted. I tried using "mag" and (mag) but neither worked. Do you know how I can get the whole of mag to be subscripted?
I've tried to remove any unnecessary script but didn't want to remove everything in case it is useful for solving this problem:
monitorSize=system("xrandr | awk '/\*/{sub(/x/,\",\");print $1; exit}'")
set macros
set terminal pngcairo size @monitorSize dashed enhanced
set style line 3 pt 1 ps 0.5 lt 1 lw 2 lc rgb "green"
set encoding iso_8859_1
plot path_to_data every ::1 using 1:18 w l ls 3 title 'U_mag \261 2'
set output 'test_2.png'
replot
Normally, I would post different questions in separate posts but I think this is related, so I will post it here. I hope that is okay.
When I run the script from terminal (on Scientific Linux), I get a whole lot of gobbledygook.
Then, at the command line, there are the following characters: 62;9;c Do you know why this is and do you know how I can stop the gobbledygook from being sent to the terminal?
When I run the script without the underscore in the legend title, as below, I don't get the plus or minus symbol. I still get the gobbledygook, but I don't get the "62;9;c" at the command line.
monitorSize=system("xrandr | awk '/\*/{sub(/x/,\",\");print $1; exit}'")
set macros
set terminal pngcairo size @monitorSize dashed enhanced
set style line 3 pt 1 ps 0.5 lt 1 lw 2 lc rgb "green"
set encoding iso_8859_1
plot path_to_data every ::1 using 1:18 w l ls 3 title 'Umag \261 2'
set output 'test_1.png'
replot
I attach 2 figures: the first showing the output from the first script; the second showing the output from the second script.
Thank you for your help!