Gnuplot is power for plotting graph in scientific progress.
I have met this problem. I want to add some commands like "$\ddot{x}$"
.
or $\tau$
on the legend.
I see some people suggest that
plot [-5:5] [-1.5:1.5] sin(x+pi) title "$\\sin(x+\\pi)$"
But it seems it does not work.
Best Answer
To get LaTeX in labels or legends in Gnuplot, you need to use one of the terminals that produce LaTeX code.
For example, you could use the
latex
terminal:That will produce a
plot.tex
file that includes the plot using basic TeX statements. You can include that file in your main document using\input{plot.tex}
:Which will give you
(notice that the quality isn't overwhelming when using the
latex
terminal).You can also use the
epslatex
terminal:This will include a
plot.tex
file with all the labels, and a separateplot.eps
file including the graphical elements. You can include the output usingAlternatively, you could create the plots directly within LaTeX, using a package like PGFPlots or pst-plot: