如何定义一个点来连接两个不同的 tikz 图片中的节点?

如何定义一个点来连接两个不同的 tikz 图片中的节点?

我需要在这个页面上定义一个点,并连接这两个不同的 tickzpicture 图形中的几个节点。

\documentclass{standalone}
\usepackage{tikz}
\usepackage{amsfonts, amsmath, amsthm, amssymb} 
\usepackage[utf8]{inputenc}
\usepackage{dtklogos}
\usepackage{tikz}
\usepackage{verbatim}
\usetikzlibrary{mindmap,shadows}
\usetikzlibrary{positioning,shapes,shadows,arrows}
\usepackage[hidelinks,pdfencoding=auto]{hyperref}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[auto, node distance = 1.2cm, thick,
every node/.style = {rectangle, font = \Large\sffamily, black,
top color = green!90!white, bottom color = green!60!white,drop shadow,
text width = 4.4cm, align = center, minimum height = 2.3cm}]
\node (4142) {\textbf{4142}};
\coordinate [below = 2.5cm of 4142] (Mitte);
\coordinate [below = 4.8cm of 4142] (Unten);
\node (EDV)        [right = 10mm of Mitte, xshift=2cm]  {4.1};
\node (Verwaltung) [left = 10mm of Mitte, xshift=-2cm]  {4.2}; 
\coordinate [below = 0.5cm of EDV] (zoode);
\coordinate [below = 0.5cm of Verwaltung] (dire);
\node (Bau)        [below = of Verwaltung] {421};
\node (Logistik)   [below  = of Bau]        {4211};
\node (Pflege)     [below = of EDV]        {411};
\node (Ausbildung) [right = of Pflege]     {412};
 \draw[line width=0.1cm, green!60!black]
(4142)    -- (Mitte) -- (Verwaltung)
(EDV)   -- (Mitte)
(EDV)   -- (zoode)
(zoode) -| (Pflege)
(zoode)  -| (Ausbildung);
\end{tikzpicture}

\begin{tikzpicture}[ every annotation/.style = {draw,
                 fill = white, font = \Large}]
 \path[mindmap, grow cyclic, concept color=black!90, text=white,
every node/.style={concept, circular drop shadow},
root/.style    = {concept,
  font=\large\bfseries\fontsize{13pt}{16pt}\selectfont, text width=10em},
level 1 concept/.append style={font=\Large\bfseries,
  sibling angle=120,  level 2/.append style={sibling angle=37.5}, text width=8.4em,
level distance=16em,inner sep=0pt},
level 2 concept/.append style={font=\bfseries,level distance=10em},
]
node[root] {INTERNAL} [clockwise from=0]
child[concept color=purple!80] {
  node {Simulations} [clockwise from=80]
    child { node (goForum) {Degradation}} 
    child { node (goWiki) {\href{http://golatex.de/wiki/Hauptseite}{Inhibition}} }
    child { node (goForum) {Drop-ins}} 
    child { node (goWiki) {\href{http://golatex.de/wiki/Hauptseite}{Pull-ups}} }
}
child[concept color=green!40!black] {
  node[concept] {Error\\Assessment}
    [clockwise from=5]
  child { node[concept, scale=1.1, font=\bf\fontsize{8pt}{14pt}\selectfont] (TikZGalerie) 
    {Precision}} 
  child { node[concept, scale=1.2, font=\bf\fontsize{7pt}{14pt}\selectfont] (TeXampleBlog)
    {Specificity}} 
  child { node[concept, scale=1.2, font=\bf\fontsize{7pt}{13pt}\selectfont] (Planet)
    {Sensitivity}} 
}
child[concept color=red!60!black] {
  node[concept] {PCR Parameters}
%node[concept] {Amplification Parameters}
    [counterclockwise from=115]
  child { node[concept] (LaTeXForum)
    {Threshold}}
child { node[concept] (LaTeXForum)
    {Saturation}}
  child { node[concept] (LaTeXArtikel)
    {Variances}} 
  child { node[concept] (LaTeXNews)
    {LSAE}} 
  };
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案1

如果这只是一个图表,那么您不需要将其拆分为两个tikzpicture环境。只需将思维导图放置在scope具有与现有 相同选项的环境中tikzpicture,但添加类似 的内容xshift=20cm,yshift=-5cm。我coordinate在上述环境之后的末尾定义了scope,并从该点绘制了一些箭头。请注意,为此,我向 添加了名称内部的错误评估思维导图中的节点。

在此处输入图片描述

\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{mindmap,shadows}
\usetikzlibrary{positioning,shapes,shadows,arrows}
\usepackage[hidelinks,pdfencoding=auto]{hyperref}
\begin{document}
\begin{tikzpicture}[auto, node distance = 1.2cm, thick,
every node/.style = {rectangle, font = \Large\sffamily, black,
top color = green!90!white, bottom color = green!60!white,drop shadow,
text width = 4.4cm, align = center, minimum height = 2.3cm}]
\node (4142) {\textbf{4142}};
\coordinate [below = 2.5cm of 4142] (Mitte);
\coordinate [below = 4.8cm of 4142] (Unten);
\node (EDV)        [right = 10mm of Mitte, xshift=2cm]  {4.1};
\node (Verwaltung) [left = 10mm of Mitte, xshift=-2cm]  {4.2}; 
\coordinate [below = 0.5cm of EDV] (zoode);
\coordinate [below = 0.5cm of Verwaltung] (dire);
\node (Bau)        [below = of Verwaltung] {421};
\node (Logistik)   [below  = of Bau]        {4211};
\node (Pflege)     [below = of EDV]        {411};
\node (Ausbildung) [right = of Pflege]     {412};
 \draw[line width=0.1cm, green!60!black]
(4142)    -- (Mitte) -- (Verwaltung)
(EDV)   -- (Mitte)
(EDV)   -- (zoode)
(zoode) -| (Pflege)
(zoode)  -| (Ausbildung);

\begin{scope}[xshift=20cm,yshift=-5cm,
           every annotation/.style = {draw,
                 fill = white, font = \Large}]
 \path[mindmap, grow cyclic, concept color=black!90, text=white,
every node/.style={concept, circular drop shadow},
root/.style    = {concept,
  font=\large\bfseries\fontsize{13pt}{16pt}\selectfont, text width=10em},
level 1 concept/.append style={font=\Large\bfseries,
  sibling angle=120,  level 2/.append style={sibling angle=37.5}, text width=8.4em,
level distance=16em,inner sep=0pt},
level 2 concept/.append style={font=\bfseries,level distance=10em},
]
node[root] (internal) {INTERNAL} [clockwise from=0]
child[concept color=purple!80] {
  node {Simulations} [clockwise from=80]
    child { node (goForum) {Degradation}} 
    child { node (goWiki) {\href{http://golatex.de/wiki/Hauptseite}{Inhibition}} }
    child { node (goForum) {Drop-ins}} 
    child { node (goWiki) {\href{http://golatex.de/wiki/Hauptseite}{Pull-ups}} }
}
child[concept color=green!40!black] {
  node[concept] (error) {Error\\Assessment}
    [clockwise from=5]
  child { node[concept, scale=1.1, font=\bf\fontsize{8pt}{14pt}\selectfont] (TikZGalerie) 
    {Precision}} 
  child { node[concept, scale=1.2, font=\bf\fontsize{7pt}{14pt}\selectfont] (TeXampleBlog)
    {Specificity}} 
  child { node[concept, scale=1.2, font=\bf\fontsize{7pt}{13pt}\selectfont] (Planet)
    {Sensitivity}} 
}
child[concept color=red!60!black] {
  node[concept] {PCR Parameters}
%node[concept] {Amplification Parameters}
    [counterclockwise from=115]
  child { node[concept] (LaTeXForum)
    {Threshold}}
child { node[concept] (LaTeXForum)
    {Saturation}}
  child { node[concept] (LaTeXArtikel)
    {Variances}} 
  child { node[concept] (LaTeXNews)
    {LSAE}} 
  };
\end{scope}

\coordinate [below=3cm of Ausbildung] (point);

\foreach \x in {Bau,Pflege,internal,error}
   \draw [latex-,ultra thick,red] (\x) -- (point);
\end{tikzpicture}
\end{document}

答案2

remember picture对原始图片使用选项overlay, remember picture,对需要绘制的线条的图片使用选项,这样就可以了(但请注意,如果两个图片中存在相同名称的节点,则可能会发生名称冲突;此外,带有选项的图片overlay不会在页面中保留任何空间):

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[red, remember picture]
\draw (0,0) coordinate (a) -- (2,0) coordinate (b) -- (1,2) node[above] (c) {yo!} -- cycle;
\end{tikzpicture}

I need to define a point on this page and connect several nodes from these two different tickzpicture figures. I need to define a point on this page and connect several nodes from these two different tickzpicture figures. I need to define a point on this page and connect several nodes from these two different tickzpicture figures. I need to define a point on this page and connect several nodes from these two different tickzpicture figures. I need to define a point on this page and connect several nodes from these two different tickzpicture figures.

\begin{tikzpicture}[blue, remember picture]
\draw (0,0) coordinate (d) -- (2,0) coordinate (e) -- (1,-2) node[below] (f) {hmm...} -- cycle;
\end{tikzpicture}

\begin{tikzpicture}[overlay, green, remember picture]
\draw[ultra thick, densely dotted] (c) to[in=180, out = 0] (f);
\end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容