Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

superscript/subscript in the labels for gnuplot read from data file

1 1 A_{3}
2 2 C_{2}
3 3 ^{5}C_{1}

I have an input file like this to be plotted. The third column is for the labels on that point (in latex format). How do I get to appear these labels on the plot as they would appear after the latex compilation (as superscript/subscript/Greek alphabet etc.)

like image 447
Population Xplosive Avatar asked Mar 13 '12 07:03

Population Xplosive


1 Answers

The syntax in the sample you give is acceptable to gnuplot's own enhanced text mode as well as to LaTeX. So it would be sufficient to say

set termopt enhanced    # turn on enhanced text mode
plot 'mydat' using 1:2:3 with labels

Most gnuplot output modes ("terminals") will accept this.

But gnuplot's enhanced text mode only handles a small subset of LaTeX. If you need more complicated stuff, you'll need to use one of the LaTeX terminals. In this case do not turn on enhanced text mode, since you want to pass the whole string through to LaTeX unprocessed.

like image 187
sfeam Avatar answered Oct 27 '22 19:10

sfeam