I have created a bash script that accesses and plots data using gnuplot. For this i have had to use the $ variable bash symbol. How can I plot an eps file where i can had a hat or tilde with special characters in the xlabels and ylabels?

$\hat{x}/ \lambda_D$

my current terminal is

set terminal postscript eps enhanced color font 'Helvetica, 18'
  • 1
    Hi and welcome, don't you have to escape the dollar sign somehow? It is really hard for me to follow, as dollar signs are used in all three languages, everytime with a different meaning. Can you elaborate a bit?
    – Johannes_B
    May 1, 2015 at 17:12

1 Answer 1


I think, you are looking for the epslatex terminal. So begin your Gnuplot script with

set terminal epslatex
set output 'output.tex'

then you can use latex notation like

set xlabel '$\hat{x}/ \lambda_D$'

this should output a .eps file with the plot and and the .tex file where the plot is embedded and the labels are set. You can use it with \input{output} in your LaTeX file.

I am not sure how your bash script works, possibly you have to escape the $, i.e. \$.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.