从 pgfplots 生成单独的 pdf 时出错

从 pgfplots 生成单独的 pdf 时出错

当我按照第 7 章 pgfplots 手册(修订版 1.8)从 pgfplots 图表生成单独的 pdf 文件时,我无法获取所需的 pdf 文件。我的文件名是 test.tex

以下是代码:

\documentclass{article}
\usepackage{amsmath}
\usepackage {tikz,pgfplots}
%\usepgfplotslibrary{external}
%\tikzexternalize
\pgfrealjobname{test}
\usetikzlibrary{shapes,arrows,shadows}
\tikzstyle{block} = [draw,fill=blue!20,rounded corners= 2pt,  rectangle, minimum    height= 2em, minimum width =4em,line width =1.5pt,drop shadow]
\tikzstyle{sum} = [draw, fill=gray!15, circle,radius = 1.5cm, node distance=1cm,line width =1.5pt,drop shadow]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]
\tikzstyle{pinstyle} = [pin edge={to-,thick,black}]
\tikzstyle{branch}=[fill,shape=circle,minimum size=4pt,inner sep=0pt]
\tikzstyle{line} = [draw, thick, color=black!50, -latex']

% The block diagram code is probably more verbose than necessary
\begin{document}
\beginpgfgraphicnamed{f1}
\begin{tikzpicture}[auto, node distance=2cm,>=latex']
% We start by placing the blocks,input output, branch

\node [input, name=input,label=left:$\phi_{des}$] {};
\node [sum, right of=input] (sum1) {};

\node [block, right of=sum1,node distance=2cm] (controller1) {$K_{p}$};
\path (sum1)--coordinate(branch1) (controller1);
\node [block, above of=controller1,node distance=1.5cm] (controller2) {$K_{i}\int e\,dt $};
\node [sum, right of=controller1,node distance=1.5cm] (sum2) {};
\node [block, right of=sum2  ] (system) {${1\over{J_xs^2}}$};
\node [block, below of=system,node distance=1.5cm 
        ] (controller3) {$K_{d}s$};
\node [input, right of= controller3, node distance = 1.35cm](y_mid){};

% We draw an edge between the controller and system block to 
% calculate the coordinate u. We need it to place the measurement block. 

\draw [->,line width =1pt] (sum2) -- node[name=u] {$\tau_{\phi}$} (system);
\node [output, right of=system,node distance =2cm] (output) {};
\path (system)--coordinate(branch2)(output);    %Finds the coordinate between system 
\path (branch2)|- coordinate(branch3)(controller3);    %Finds the coordinate between 

\node[input,name= feedback,below of= sum2,node distance=2.5cm]{};
% Once the nodes are placed, connecting them is easy. 

\draw [draw,->,line width =1pt] (input) -- node[pos =0.9] {$+$} (sum1);
\draw [->,line width =1pt] (sum1) -- node[pos =0.1]{$e$} (controller1);

\draw [->,line width =1pt] (branch1)node[branch]{} |-  (controller2);
\draw[->,line width =1pt](controller2)-|node[pos =0.95]{$+$} (sum2);

\draw [->,line width =1pt] (controller1) -- node [pos =0.9]{$+$} (sum2);

\draw [->,line width =1pt] (system) -- node[name =y]  {$\phi$}(output);
\draw[line width =1pt](branch2)node[branch]{}|- (controller3);

\draw [line width =1pt] (branch3) |-  (feedback);

\draw [->,line width =1pt] (controller3) -| node[pos=0.95]{$-$}(sum2);
\draw [->,line width =1pt] (feedback) -| node[pos=0.97]{$-$}(sum1);

\end{tikzpicture}
\endpgfgraphicnamed
\end{document}

我首先命令“pdflatex”,然后命令“pdflatex --jobname f1 test”

测试.tex

包 pgfplots 警告:以向后兼容模式运行(不适合

— 30​​ 软件包 amsmath 警告:在输入行 30 中,应使用外部命令 \over;\frac 或 \genfrac。

相关内容