我有以下代码来绘制流程图:
\documentclass{article}
\usepackage{rotating}
\usepackage{tikz}
\usetikzlibrary{arrows,
positioning,
shapes.geometric}
\begin{document}
\usetikzlibrary{arrows, positioning, shapes.geometric}
\begin{figure}[h!] %The block diagram code is probably more verbose than necessary
\centering
\begin{tikzpicture}[scale = 0.85, transform shape,
node distance=5mm and 20mm,
% Define block styles
base/.style = {draw, text width=28mm, minimum height=10mm, align=center},
baseL/.style = {draw, text width=65mm, minimum height=10mm, align=center},
baseS/.style = {draw, text width=28mm, minimum height=10mm, align=center},
startstop/.style = {base, rounded corners, fill=red!30},
io/.style = {trapezium, trapezium left angle=70, trapezium right angle=110,
base,
text width=#1, fill=blue!30},
io/.default = 7em,
processL/.style = {baseL, fill=orange!30},
processS/.style = {baseS, fill=orange!30},
decision/.style = {diamond, aspect=1.5,
base, fill=green!30},
arrow/.style = {thick,-stealth}
]
\node (start) [startstop] {Start};
\node (LAB1) [processL, below=of start] {Implementation of LabVIEW program for acquisition and calibration of IMU measurements};
%-----------------------------------------------------------%
\node (in1) [io, below left=of LAB1] {Calculate $K_0$, at the idle state of IMU};
\node (in2) [io, below =of LAB1] {Calculate $\overline{S}$ and $\sigma^{2}$};
\node (in3) [io, below right=of LAB1] {Calculate $K$};
%-----------------------------------------------------------%
\node (LAB2) [processS, below=of in2] {Accuracy analysis};
\node (LAB3) [processL, below=of LAB2] {Implementation of LabVIEW program for acquisition of corrected IMU measurements, using $K_0$ and $K$};
\node (testdrive) [processL, below=of LAB3] {Conducting test drive and IMU orientations and tachymeter position measurements};
\node (evaluation) [processL, below=of testdrive] {Evaluation of recorded data};
\node (comparison) [processL, below=of evaluation] {Comparison of IMU measurements with three methods};
\node (stops) [startstop, below=of comparison] {Stop};
%-----------------------------------------------------------%
\draw [arrow] (start) -- (LAB1);
%-----------------------------------------------------------%
\draw [arrow] (LAB1) -| (in1); % to diamonds
\draw [arrow] (LAB1) -- (in2);
\draw [arrow] (LAB1) -| (in3);
%-----------------------------------------------------------%
\draw [arrow] (in2) -- (LAB2); % from diamonds
\draw [arrow] (in1) |- (LAB3);
\draw [arrow] (in3) |- (LAB3);
%-----------------------------------------------------------%
\draw [arrow] (LAB3) -- (testdrive);
\draw [arrow] (testdrive) -- (evaluation);
\draw [arrow] (evaluation) -- (comparison);
\draw [arrow] (comparison) -- (stops);
\end{tikzpicture}
\caption{Flow-chart}}
\label{figure3111111}
\end{figure}
\end{document}
但是,虽然我已将三个设置成单一设置(图中已标记),但平行四边形的尺寸却不同。您能帮我让它们对称吗?
其次,经过精度分析,我希望在之间留出更多空间:
精度分析
和
实现 LabVIEW 程序以获取 IMU 测量值,并使用 $K_0$ 和 $K$ 进行校正
比我定义的要多。垂直距离。
由于我有一个流程图的全局设置,因此我无法更改它。你能帮我吗?
答案1
像这样?
我对您的代码做了以下更改:
- 稍微减少
io
节点之间的距离。 - 重新定义
io
节点样式定义 - 删除我认为多余的样式定义
tikz
删除库的双重加载\documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows, positioning, shapes.geometric} \begin{document} \begin{figure}[h!] \centering \begin{tikzpicture}[ node distance=5mm and 10mm, % Define block styles base/.style = {draw, text width=28mm, minimum height=10mm, align=center}, startstop/.style = {base, rounded corners, fill=red!30}, io/.style args = {#1/#2}{trapezium, trapezium stretches body, trapezium left angle=70, trapezium right angle=110, draw, fill=blue!30, minimum width=#1, minimum height=#2, text width =\pgfkeysvalueof{/pgf/minimum width}-2*\pgfkeysvalueof{/pgf/inner xsep}, align=center}, processL/.style = {base,text width=65mm, fill=orange!30}, processS/.style = {base, fill=orange!30}, decision/.style = {diamond, aspect=1.5, base, fill=green!30}, arrow/.style = {thick,-stealth} ] \node (start) [startstop] {Start}; \node (LAB1) [processL, below=of start] {Implementation of LabVIEW program for acquisition and calibration of IMU measurements}; %-----------------------------------------------------------% \begin{scope}[io/.default = 7em/13mm] \node (in1) [io, below left=of LAB1] {Calculate $K_0$, at the idle state of IMU}; \node (in2) [io, below =of LAB1] {Calculate $\overline{S}$ and $\sigma^{2}$}; \node (in3) [io, below right=of LAB1] {Calculate $K$}; \end{scope} %-----------------------------------------------------------% \node (LAB2) [processS, below=of in2] {Accuracy analysis}; \node (LAB3) [processL, below=of LAB2] {Implementation of LabVIEW program for acquisition of corrected IMU measurements, using $K_0$ and $K$}; \node (testdrive) [processL, below=of LAB3] {Conducting test drive and IMU orientations and tachymeter position measurements}; \node (evaluation) [processL, below=of testdrive] {Evaluation of recorded data}; \node (comparison) [processL, below=of evaluation] {Comparison of IMU measurements with three methods}; \node (stops) [startstop, below=of comparison] {Stop}; %-----------------------------------------------------------% \draw [arrow] (start) edge (LAB1) (LAB1) edge (in2) (in2) edge (LAB2) (LAB3) edge (testdrive) (testdrive) edge (evaluation) (evaluation) edge (comparison) (comparison) to (stops); %-----------------------------------------------------------% \draw [arrow] (LAB1) -| (in1); % around trapecium \draw [arrow] (LAB1) -| (in3); \draw [arrow] (in1) |- (LAB3); \draw [arrow] (in3) |- (LAB3); \end{tikzpicture} \caption{Flow-chart} \label{figure3111111} \end{figure} \end{document}