\begin{document}
\pagestyle{empty}
% Define block styles
\tikzstyle{decision} = [diamond, draw, fill=white!20,
text width=5.5em, text badly centered, node distance=5cm, inner sep=0pt]
\tikzstyle{block} = [rectangle, draw, fill=white!20,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex']
\tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=5cm,
minimum height=5em]
\begin{tikzpicture}[node distance = 4cm, auto]
% Place nodes
\node [block] (sume) {1.-Sume variables de holgura (forma estándar)};
\node [block, below of=sume] (calcu) {2.-Calcule una primer solución básica factible};
\node [decision, below of=calcu] (decide) {3.-¿Existe una solución básica factible adyacente que sea mejor?};
\node [block, right of=decide, node distance=5cm] (no) {5.-Entonces la solucion basica factible actual es óptima};
\node [block, left of=decide, node distance=5cm] (yes) {4.-Entonces calcule el valor de la funcion $Z$ para la nueva solucion básica factible};
% Draw edges
\path [line] (sume) -- (calcu);
\path [line] (calcu) -- (decide);
\path [line] (decide) -- node {Si} (yes);
\path [line] (yes) -| (calcu);
\path [line] (decide) -- node {No} (no);
\end{tikzpicture}
\end{document}
Latex でフローチャートを作成するのは今回が初めてです。これまで作成してきましたが、結果はひどいものでした。私が持っている画像に似たものにするために、どなたか手伝っていただけますか?
- これは私がやったことの結果です。問題は4から2に向かう矢印が反転していることです。どうすれば解決できますか?
- 矢印を太く見せるにはどのような指示が必要ですか?
答え1
これがあなたが求めているものなのでしょうか?
問題は4から2に向かう矢印が反転していることです。どうすれば解決できますか?
\path [line] (yes.west) --+(-1cm,0) |- (h); %
(yes.west)
左に1cm引いてから垂直に上と水平に進み、(h)
コードがnode
定義するポイントまで進みます。(h)
矢印を太く見せるにはどのような命令を使うのでしょうか?
line
tizstyleで定義されているスタイルを変更してthick
、、またはvery thick
、またはを追加します。line width=xx pt
チェックしてくださいTikZ スタイルを定義するには、\tikzset または \tikzstyle を使用する必要がありますか?
矢印を太く見せることについての質問が矢じりに関するものであれば、TikZ/PGF で矢印のサイズを変更することは可能ですか?
下の画像が表示されます
コード
\documentclass[tikz,border=1cm]{standalone}
\usetikzlibrary{matrix, shapes, arrows,calc, positioning}
\begin{document}
\pagestyle{empty}
% Define block styles
\tikzstyle{decision} = [diamond, draw, fill=white!20,
text width=3cm, text badly centered, node distance=5cm, inner sep=0pt]
\tikzstyle{block} = [rectangle, draw, fill=white!20,
text width=3cm, text centered, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex']
\tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm,
minimum height=5em]
\begin{tikzpicture}[node distance = 4cm, auto]
% Place nodes
\node [block] (sume) {1.-Sume variables de holgura (forma estándar)};
\node [block, below of=sume] (calcu) {2.-Calcule una primer solución básica factible};
\node [decision, below of=calcu] (decide) {3.-¿Existe una solución básica factible adyacente que sea mejor?};
\node [block, below right =1cm and 1 cm of decide, node distance=5cm] (no) {5.-Entonces la solucion basica factible actual es óptima};
\node [block, below left = 1cm and 1cm of decide, node distance=5cm] (yes) {4.-Entonces calcule el valor de la funcion $Z$ para la nueva solucion básica factible};
% Draw edges
\path [line] (sume) -- (calcu);
\path [line] (calcu) --node[pos=0.5](h){} (decide);
\path [line] (decide) -| node[pos=0.2,above] {Si} (yes);
\path [line] (yes.west) --+(-1cm,0) |- (h);
\path [line] (decide) -| node[pos=0.2,above] {No} (no);
\end{tikzpicture}
\end{document}