问题
Using the following script in gnuplot (v 5.0) to generate a graph
set terminal epslatex
unset key
set xlabel "$\zeta$"
set ylabel "$\rho$"
set output "strange_graph.tex"
plot sin(x)
set terminal wxt
set o
along with a latex document to include it,
\documentclass{article}
\usepackage{amssymb}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\begin{center}
\include{strange_graph}
\end{center}
\end{figure}
\end{document}
the Greek letters rho and zeta do not appear on the axes, and furthermore r has disappeared from the y-axis, leaving "ho".
How do I fix this problem, and what is going on?
(And no, please don't ask me for an image, apparently I don't have enough reputation to upload one.)
回答1:
You must either escape the backslashes, when using double quotes,
set xlabel "$\\zeta$"
set ylabel "$\\rho$"
or use single quotes
set xlabel '$\zeta$'
set ylabel '$\rho$'
来源:https://stackoverflow.com/questions/28964500/math-in-axes-labels-for-gnuplot-epslatex-terminal-not-formatted-correctly