PGFPlots 的外部创建不起作用

PGFPlots 的外部创建不起作用

由于使用创建的图表数据量很大,我遇到了内存问题pgfplots。因此我想使用外部模式,但无法创建可用的文件。

这是我的代码:

\documentclass[11pt, a4paper, twoside, fleqn, ngerman]{scrreprt}
\usepackage{pgfplots}
\usepgfplotslibrary{external}
\tikzexternalize[shell escape=-enable-write18]
\usepackage{tikz}

\begin{document}
\begin{figure}[ht]
    \centering
        \input{plot.tikz}
    \caption{...}
    \label{fig:a}
\end{figure}
\end{document}

plot.tikz这是包含的文件:

\definecolor{mycolor1}{rgb}{0.00000,1.00000,1.00000}% is used for other addplots not shown

\begin{tikzpicture} 

\begin{axis}[% 
width=5cm, 
height=5cm, 
at={(0.758in,0.481in)}, 
scale only axis, 
xmin=-1, 
xmax=1, 
xlabel style={font=\bfseries}, 
xlabel={Real z}, 
ymin=-1, 
ymax=1, 
ylabel style={font=\bfseries}, 
ylabel={Imag z}, 
axis background/.style={fill=white} 
] 
\addplot [color=black,solid,line width=1.5pt,forget plot] 
  table[row sep=crcr]{% 
0.52    0.67\\ 
0.82    0.67\\ 
}; 

\addplot [color=black,solid,line width=1.5pt,forget plot] 
  table[row sep=crcr]{% 
0.52    -0.67\\ 
0.82    -0.67\\ 
}; 

%% Several other \addplot's 
\end{axis} 
\end{tikzpicture}% 

该代码给出了以下错误:

! Package tikz Error: Sorry, the system call 'pdflatex -halt-on-error
    -interaction=batchmode -jobname "test_pgf-figure0"
    "\def\tikzexternalrealjob{test_pgf}\input{test_pgf}"'
did NOT result in a usable output file 'test_pgf-figure0'
(expected one of .pdf:.jpg:.jpeg:.png:). Please verify that you have enabled
system calls. For pdflatex, this is 'pdflatex -shell-escape'. Sometimes it is
also named 'write 18' or something like that. Or maybe the command simply
failed? Error messages can be found in 'test_pgf-figure0.log'. If you continue
now, I'll try to typeset the picture.

所提到的test_pgf-figure0.log文件也未被创建。

我读过一个解决方案,其中提到手动编译每个文件,但我需要大约 30 个或更多将来可能会改变的数字。因此我不想一遍又一遍地重复这一操作。

相关内容