math in axes labels for gnuplot (epslatex terminal) not formatted correctly

拈花ヽ惹草 提交于 2019-12-04 06:38:12

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!