2011-02-07 66 views
2

我经历的MacPorts安装gnuplot的,但是当我编译的TeXShop我的乳胶文件它并不显示情节和我在日志文件中这些错误:的gnuplot用的TeXShop在OSX

Package pgf Warning: Plot data file `tutorial.x.table' not found. on input line 
17. 


Package pgf Warning: Plot data file `tutorial.sin.table' not found. on input li 
ne 19. 


Package pgf Warning: Plot data file `tutorial.exp.table' not found. on input li 
ne 21. 

我只是想编译这个基本的例子:

% Author: Till Tantau 
% Source: The PGF/TikZ manual 
\documentclass{article} 

\usepackage[latin1]{inputenc} 
\usepackage{tikz} 

% GNUPLOT required 
\begin{document} 
\pagestyle{empty} 


\begin{tikzpicture}[domain=0:4] 
    \draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9); 
    \draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$}; 
    \draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$}; 
    \draw[color=red] plot[id=x] function{x} 
     node[right] {$f(x) =x$}; 
    \draw[color=blue] plot[id=sin] function{sin(x)} 
     node[right] {$f(x) = \sin x$}; 
    \draw[color=orange] plot[id=exp] function{0.05*exp(x)} 
     node[right] {$f(x) = \frac{1}{20} \mathrm e^x$}; 
\end{tikzpicture} 


\end{document} 

回答

1

是的,你需要将tikz创建的.gnuplot文件转换成表格文件。您有此两种选择:

  1. 您可以运行附加命令行开关--shell逃逸,有时也被称为--enable-写-18(PDF格式)乳胶,然后gnuplot的自动为运行您。 (尽管允许在pdflatex中启动任意程序,但您可能并不习惯)。

  2. 您可以自己在test.exp.gnuplot,test.sin.gnuplot,test.x.gnuplot等上运行gnuplot 。文件。只需gnuplot test.exp.gnuplot应该这样做。 (这里不能验证,因为我的gnuplot版本太旧了。)

+1

它的工作原理!因此,“--shell-escape”位于“preferences-> Engine”之下,并将“pdfTeX”作为“pdftex”和“pdflatex”之后的第一个参数。你摇滚 – 2011-02-07 11:00:02