Gnuplot 的问题

Gnuplot 的问题

我是 LaTex 的初学者,也是 gnuplot 的绝对新手。我使用的是 Texstudio 和 Windows 8.1。问题是 - 我无法让 LaTex 显示简单的图像。可能是某些设置问题。具体来说,我从网上获取了最简单的 gnuplot 代码(略作调整):

这是我的图表的 gnuplot 代码:

reset 
set key inside left top vertical Right noreverse enhanced autotitles box linetype -1 linewidth 1.000
set samples 50, 50
plot [-10:10] sin(x),atan(x),cos(atan(x))
set term pslatex auxfile
set output 'proba1.tex'     
replot 

这是我得到的文件(test1.tex)(除了 ps 文件):

% GNUPLOT: LaTeX picture with Postscript
\begingroup%
\makeatletter%
\newcommand{\GNUPLOTspecial}{%
\@sanitize\catcode`\%=14\relax\special}%
\setlength{\unitlength}{0.0500bp}%
\begin{picture}(7200,5040)(0,0)%
\special{psfile=proba1.ps llx=0 lly=0 urx=360 ury=252 rwi=3600}
\put(2340,4236){\makebox(0,0)[r]{\strut{}cos(atan(x))}}%
\put(2340,4436){\makebox(0,0)[r]{\strut{}atan(x)}}%
\put(2340,4636){\makebox(0,0)[r]{\strut{}sin(x)}}%
\put(6839,200){\makebox(0,0){\strut{} 10}}%
\put(5324,200){\makebox(0,0){\strut{} 5}}%
\put(3809,200){\makebox(0,0){\strut{} 0}}%
\put(2295,200){\makebox(0,0){\strut{}-5}}%
\put(780,200){\makebox(0,0){\strut{}-10}}%
\put(660,4799){\makebox(0,0)[r]{\strut{} 1.5}}%
\put(660,4066){\makebox(0,0)[r]{\strut{} 1}}%
\put(660,3333){\makebox(0,0)[r]{\strut{} 0.5}}%
\put(660,2599){\makebox(0,0)[r]{\strut{} 0}}%
\put(660,1866){\makebox(0,0)[r]{\strut{}-0.5}}%
\put(660,1133){\makebox(0,0)[r]{\strut{}-1}}%
\put(660,400){\makebox(0,0)[r]{\strut{}-1.5}}%
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               \end{picture}%
\endgroup
\endinput

这是 LaTex 文本:

\documentclass[11pt,twoside,a4paper]{article}
\usepackage{graphicx}
\begin{document}
gnuplot test
\begin {figure}
\begin{center}
\input{test1.tex}
\end{center}
\end {figure}
\end{document}

这可能看起来很傻,但我已经找了好几天的解决方案了,但没有成功。非常感谢。Marko

答案1

好的,感谢你们,我终于找到了解决方案:首先,正如 mvkorpel 注意到的,gnuplot 确实创建了不完整的 tex 文件。我不得不unset output在 gnuplot 中写入,然后我得到了一个完整的 tex 文件。根据 gnuplot FAW,某些输出格式必须像这样明确关闭。之后我latex+dvips+ps2pdf按照 egreg 的建议使用了。这解决了问题。再次感谢。

相关内容