I know that gnuplot's
epslatex terminal can display superscipts and subscripts in titles and label axes. Is this also possible when using gnuplot's
If so, how does one do this?
Computational Science Stack Exchange is a question and answer site for scientists using computers to solve scientific problems. It only takes a minute to sign up.Sign up to join this community
You can't just use TeX syntax unless you are using the TiKZ, epslatex, or another terminal that uses LaTeX to process the labels. You can get some fairly crude math layout, including superscripts and subscripts, by using the enhanced text option to many of gnuplot's terminals, including, sometimes, png. But you will have to use the gnuplot enhanced text syntax, which is unrelated to (La)TeX syntax. Fortunately, some of the syntax happens to coincide, including the basic use of superscripts and subscripts. On my system enhanced text works with the pngcairo terminal but not plain png. If you don't have that, you can try others, such as svg. I have plenty of examples of using both LaTeX and enhanced text in my new book.
It is possible to use LaTeX syntax for super- and subscripts in axes labels and titles when the terminal is set to
To to this, set the terminal with
set term png enhanced font "/full/path/to/font"
and then plot normally.
If the font part isn't included, you may get this error message:
gdImageStringFT: Could not find/open font
This means gnuplot can't find the plots on your system. On linux, fonts are generally located in