这里是创建图表的链接,但没有圆圈。
答案1
链接下的图片与截图看起来非常不同。但正如您所指的那样,我用它来展示如何在两个节点周围绘制虚线椭圆。
% TikZ chains with labeled edges
% Author: Stefan Kottwitz , http://texblog.net
\documentclass[a4paper,10pt]{article}
\usepackage{tikz}
\usetikzlibrary{arrows,chains,matrix,positioning,scopes,calc,fit,shapes.geometric}
%
\makeatletter
\tikzset{join/.code=\tikzset{after node path={%
\ifx\tikzchainprevious\pgfutil@empty\else(\tikzchainprevious)%
edge[every join]#1(\tikzchaincurrent)\fi}}}
\makeatother
%
\tikzset{>=stealth',every on chain/.append style={join},
every join/.style={->}}
\tikzset{labeled/.style={execute at begin node=$\scriptstyle,
execute at end node=$}}
%
\begin{document}
\begin{tikzpicture}
\matrix (m) [matrix of math nodes, row sep=3em, column sep=3em]
{ 0 & A & B & C & 0 \\
0 & A' & B' & C' & 0 \\ };
{ [start chain] \chainin (m-1-1);
\chainin (m-1-2);
{ [start branch=A] \chainin (m-2-2)
[join={node[right,labeled] {\eta_1}}];}
\chainin (m-1-3) [join={node[above,labeled] {\varphi}}];
{ [start branch=B] \chainin (m-2-3)
[join={node[right,labeled] {\eta_2}}];}
\chainin (m-1-4) [join={node[above,labeled] {\psi}}];
{ [start branch=C] \chainin (m-2-4)
[join={node[right,labeled] {\eta_3}}];}
\chainin (m-1-5); }
{ [start chain] \chainin (m-2-1);
\chainin (m-2-2);
\chainin (m-2-3) [join={node[above,labeled] {\varphi'}}];
\chainin (m-2-4) [join={node[above,labeled] {\psi'}}];
\chainin (m-2-5); }
\path let \p1=(m-1-1), \p2=(m-2-2), \n1={atan2(\y2-\y1,\x2-\x1)} in
node[draw,dashed,ellipse,inner sep=0pt,rotate fit=\n1,fit=(m-1-1) (m-2-2)]{}; %added
\end{tikzpicture}
\end{document}
为了绘制类似您的图形,我实际上不会使用链,因为您的箭头样式各不相同。要在椭圆之间(或椭圆与另一个节点之间)绘制箭头,只需给它们命名。我绘制了您的图形的上半部分,其余部分只是重复。
\documentclass[a4paper,10pt]{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,matrix,calc,fit,shapes.geometric}
\newcommand{\DrawEllipse}[3][]{
\path let \p1=#2, \p2=#3, \n1={atan2(\y2-\y1,\x2-\x1)} in
node[draw,ellipse,inner sep=0pt,rotate fit=\n1,fit=#2 #3,#1]{};}
%
\begin{document}
\begin{tikzpicture}
\matrix (m) [matrix of nodes, row sep=3em, column sep=3em]
{ LEM & LPO & MP & WMP \\
WLEM & WLPO & & \\
& WKL & & \\
&|[label={[xshift=-1cm,name=lab,above left,font=\tiny]AC}]| LLPQ & MP\textsuperscript{V} & \\};
\draw[double,-latex] (m-1-1) -- (m-1-2);
\draw[double,-latex] (m-1-2) -- (m-1-3);
\draw[very thick,-latex] (m-1-3) -- (m-1-4);
%
\draw[double,-latex] (m-1-1) -- (m-2-1);
\draw[very thick,-latex] ([xshift=-1mm]m-1-2.south) -- ([xshift=-1mm]m-2-2.north);
\draw[double,-latex] ([xshift=1mm]m-1-2.south) -- ([xshift=1mm]m-2-2.north);
\draw[very thick,-latex] ([xshift=-1mm]m-2-2.south) -- ([xshift=-1mm]m-3-2.north);
\draw[double,-latex] ([xshift=1mm]m-2-2.south) -- ([xshift=1mm]m-3-2.north);
\draw[very thick,-latex] (m-1-3) -- (m-4-3);
\draw[very thick,-latex] (m-3-2) -- (m-4-2);
\DrawEllipse[dashed,name=el1]{(m-2-2)}{(m-1-3)}
\DrawEllipse[dashed,name=el2]{(m-4-3)}{(m-1-4)}
\DrawEllipse[dashed,name=el3]{(m-4-2)}{(lab)}
\draw[<->] (el1.south east) -- (el2.30);
\draw[<->] (el3.-60) -- (m-3-2);
\draw[double,-latex] (el3.west |- m-4-2) -- (el2.west |- m-4-3);
\end{tikzpicture}
\end{document}