我绘制了以下图像: 使用此代码:
\documentclass[10pt,a4paper,twocolumn]{article}
\usepackage{bondgraph} %Draw bondgraphs
\usetikzlibrary[petri] % Petri nets
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}[yscale=-1.1,thin,>=stealth, every transition/.style={fill,minimum width=1mm,minimum height=3.5mm}, every place/.style={draw,thick,minimum size=6mm}]
\node[place,tokens=0,label=above:$p_G$] (pG) {};
\node[transition,right=of pG,label=below:$t_{GY}$] (t1) {}
edge[pre] (pG);
\node[place,right=of t1,tokens=0,label=above:$p_Y$] (pY) {};
%edge[pre] (t1);
\node[transition,right=of pY,label=below:$t_{YR}$] (t2) {};
\node[place,right=of t2,tokens=1,label=above:$p_R$] (pR) {};
\node[transition,above=of pY,label=below:$t_{RG}$] (t3) {};
\draw [->] (t1) -- (pY);
\draw [->] (pY) -- (t2);
\draw [->] (t2) -- (pR);
\draw [->] (pR) to [out=315,in=0] (t3);
\draw [->] (t3) to [out=180,in=135] (pG);
%\draw [->] (t3) to [out=0,in=180,bend left] (pG);
\end{tikzpicture}
\caption{Petri net model for traffic lights}
\label{fig:task1pet1}
\end{figure}
\end{document}
t_{RG}
我怎样才能改变从 到的箭头的形式p_G
,使它成为从p_R
到 的箭头的镜像版本t_{RG}
?
答案1
根据 Paul 和 Torbjørn 的建议,我尝试将我之前的评论转换成完整的答案。在这样做的过程中,我发现虽然我的解决方案有效,但这只是偶然的。
我之前的解决方案是\draw [->] (t3) to [out=180,in=135] (pG);
改变
\draw [<-] (pG) to [out=225,in=180] (t3);
。
这产生了预期的结果:
现在我认为 MWijnand 发现了to path
库中{x|y}scale
存在负值时的错误行为,因此这里是follow up question
以确认这一点。