如何修改 Tikz 中箭头的起点位置?

如何修改 Tikz 中箭头的起点位置?

我用箭头将节点 1 连接到节点 2。箭头与标签重叠。我希望箭头从标签开始,而不是从节点本身开始。可以吗?

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[showframe,
        paperheight=14in,paperwidth=8.5in,
        margin=2in,heightrounded]{geometry}
 \usepackage{amsfonts, amsmath, amsthm, amssymb} 
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{positioning,shadows}
\begin{document}
\thispagestyle{empty}
 \centering
 \begin{tikzpicture}[%auto, thick, 
 node distance = 3.6mm and 9mm, 
C/.style args = {#1/#2}{% Color
top color = #1, bottom color=#2},
C/.default = green!40!white/green!20!white,
 N/.style = {% Node
rectangle, rounded corners=2pt, 
minimum width= 24mm, font = \sffamily, 
align=center, inner xsep=1ex,
drop shadow, minimum height = 5mm}, 
every label/.style = {shape=circle, fill=white, text width=4.5ex, align=center,
       inner sep=1pt, font=\sffamily\scriptsize, drop shadow,
       yshift=0.17cm, xshift=-0.15cm}
                                      ]
\node [N,C,font=\bfseries\sffamily] (SWGDAM)   {SWGDAM Guidelines for Validation \\of
                                            Probabilistic Genotyping Systems};
 \node [N,C,label=right:4.2,
   below=of SWGDAM.south east]     
                                        (42)    {Comparative\\ Study};
\node[N,C,label=right:4.1,below=of 42]      (41)    {Data\\ Generation};
 \node[N,C,label=right:4.2.1,below=of 41]    (421)   {Consistency};
\node[N,C=yellow/yellow,
  label=right:4.2.1.1, below=of 421]   (4211)   {Method\\ Comparison};

\node[N,C=gray!40!white/gray!40!white,font=\bfseries\sffamily,
  label=right:7, below = of SWGDAM]     (intval)    {Internal\\ Validation};
\node[N,C=gray!20!white/white,
  label=right:7.1.1,below = of intval]  (711b)  {Template\\ Concentration};
\node[N,C=gray!20!white/white,
   label=right:7.1.2,below = of 711b]   (712b)  {Node 2};

 \node[N,C=gray!20!white/white,
  label=right:3333,below = of SWGDAM.south west]   (3333)  {Node 1};

 \draw [->,red] (3333.north east) to [out=360,in=180] (712b.west);     

  \end{tikzpicture}
   \end{document}

enter image description here

答案1

是的,您可以像这样命名标签label={[name=A]right:3333}

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[showframe,
        paperheight=14in,paperwidth=8.5in,
        margin=2in,heightrounded]{geometry}
 \usepackage{amsfonts, amsmath, amsthm, amssymb} 
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{positioning,shadows}
\begin{document}
\thispagestyle{empty}
 \centering
 \begin{tikzpicture}[%auto, thick, 
 node distance = 3.6mm and 9mm, 
C/.style args = {#1/#2}{% Color
top color = #1, bottom color=#2},
C/.default = green!40!white/green!20!white,
 N/.style = {% Node
rectangle, rounded corners=2pt, 
minimum width= 24mm, font = \sffamily, 
align=center, inner xsep=1ex,
drop shadow, minimum height = 5mm}, 
every label/.style = {shape=circle, fill=white, text width=4.5ex, align=center,
       inner sep=1pt, font=\sffamily\scriptsize, drop shadow,
       yshift=0.17cm, xshift=-0.15cm}
                                      ]
\node [N,C,font=\bfseries\sffamily] (SWGDAM)   {SWGDAM Guidelines for Validation \\of
                                            Probabilistic Genotyping Systems};
 \node [N,C,label=right:4.2,
   below=of SWGDAM.south east]     
                                        (42)    {Comparative\\ Study};
\node[N,C,label=right:4.1,below=of 42]      (41)    {Data\\ Generation};
 \node[N,C,label=right:4.2.1,below=of 41]    (421)   {Consistency};
\node[N,C=yellow/yellow,
  label=right:4.2.1.1, below=of 421]   (4211)   {Method\\ Comparison};

\node[N,C=gray!40!white/gray!40!white,font=\bfseries\sffamily,
  label=right:7, below = of SWGDAM]     (intval)    {Internal\\ Validation};
\node[N,C=gray!20!white/white,
  label=right:7.1.1,below = of intval]  (711b)  {Template\\ Concentration};
\node[N,C=gray!20!white/white,
   label=right:7.1.2,below = of 711b]   (712b)  {Node 2};

 \node[N,C=gray!20!white/white,
  label={[name=A]right:3333},below = of SWGDAM.south west]   (3333)  {Node 1};

 \draw [->,red] (A.south) to [out=270,in=180] (712b);     

  \end{tikzpicture}
   \end{document}

相关内容