放大 Tikz 思维导图

放大 Tikz 思维导图

我创建了这个思维导图来阐明我所构建的一个大系统。

在此处输入图片描述

当我描述它时,我需要将一小部分思维导图与文本一起提供,以便读者更好地理解我正在写哪个部分。

是否可以只显示思维导图的一部分?也许是“放大”效果或“隔离”分支或“焦点”?欢迎提出想法。一个想法是将一部分显示为如下形式:

在此处输入图片描述

更新的问题以显示我目前得到的结果并将代码放在一个文件中

以下是 MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{tikz}
\usetikzlibrary{mindmap,shadows,backgrounds}

\begin{document}
\begin{figure}[ht]
\centering
\resizebox{0.8\textwidth}{!}{
\begin{tikzpicture}
\colorlet{mmcolor1}{green!50!black}
\definecolor{mmcolor2}{HTML}{673AB7}
\colorlet{mmcolor21}{red!50!black}
\colorlet{mmcolor3}{red!40}
\definecolor{mmcolor4}{HTML}{3380FF}
\colorlet{mmcolor5}{orange}
\colorlet{mmcolor6}{blue}
\colorlet{mmcolor7}{blue!80!white!60!green}

\coordinate (a) at (8.2,7.5);
\coordinate (b) at (6,7.5);
\coordinate (c) at (2.1,5);
\coordinate (d) at (2.1,-1.5);
\coordinate (e) at (6,-3.6);
\coordinate (f) at (8.2,-3.6);

\draw (a)--(b)--(c)--(d)--(e)--(f)--cycle;
%\clip (a)--(b)--(c)--(d)--(e)--(f)--cycle; %The problem is here


\path[mindmap, concept color=mmcolor1, text=white]
    node [concept] {\textbf{Central\\ Node\\ with a big\\ title.}}%
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    child [grow = 90,concept color=mmcolor2]{
      node[concept] {Sablabla Measurements}
      child [grow = 180, level distance=3.6cm]{ node[concept](aaaa)    {AAAA} }
      child [grow = 135]{ node[concept](bbb)     {BBB}  }
      child [grow = 90] { node[concept](nnnn) {NNNN}
        child [grow = -30] {node[concept,font=\normalsize] (pyyy) {pyyy Yyy}} }
    }%
    %%%%%%%%%%%%%%%%%%%%%%%%%%
    child [grow=180,concept color=mmcolor3]{
    node[concept] {Pablablablabla Measurements}
        child [grow=90]{
        node[concept,scale=1.2,font=\tiny] {Pablablablabla Mmmmmmm} }
    }%
    %%%%%%%%%%%%%%%%%%%%%%%%%%
    child [concept color=mmcolor4, grow=45]{
      node[concept] {Immmmmmmmmm Tiiiii}
      child [grow=0, level distance=3.4cm] { node[concept](reeeeee){reeeeee}
        child [grow=90,text width=1.5cm]{
        node[concept,font=\footnotesize] {Hhhhhhhh\\ Aaaaaaa} }}
      child [grow=-45]{ node[concept](coooooooo) {coooooooo} }
      child [grow=-90]{ node[concept](nbbbb) {Nbbbbb} }
    }%
    %%%%%%%%%%%%%%%%%%%%%%%%%%
    child [concept color=mmcolor5, grow=-140] {%
      node[concept] {Piiiiiiiiiii Peeeeeeeeeeee}
      child [grow=-45]  { node[concept](eee) {BBBB (eee)} }
      child [grow=-90,level distance=3.3cm]  { node[concept](ppp) {HHHHH (ppp)} }
      child [grow=0]    { node[concept](yyyyyyyy) {YYYY\\(yyy-yyyyyyy)} }
    };

%%%%%%%%%%%% 
\path[mindmap,concept color=mmcolor2, text=white]
    node[concept,scale=0.5,font=\huge](gooooo) at (-3,10){Gooooo\\ foooo};

%%%%%%%%%%%% 
\path[mindmap,concept color=mmcolor21, text=white]
    node[concept,scale=0.5,font=\huge](suuuuuuuuuuuuu) at (2,10){Suuuuuuuu Meeeeee};

%%%%%%%%%%%% 
\path[mindmap,concept color=mmcolor4, text=white]
    node[concept,scale=0.5,font=\huge](pssssssss) at (7,-2){pssssssss};

%%%%%%%%%%%%
\path[mindmap,concept color=mmcolor5, text=white]
    node[concept,scale=0.5,font=\huge](oppppp) at (0.7,-6.5){oppppp\\ Cyyyy};

%%%%%%%%%%%%
\path[mindmap,concept color=blue, text=white]%
    node[concept,scale=0.5,font=\huge](lsl) at (3.5,-4){Laa\\ Aaaaaaaa\\ Aaaaa}
    child [grow=-30,concept color=mmcolor7,level distance=3.3cm]{%
    node[concept,scale=0.8,font=\small] {Opppp Live}}
    child [grow=-90,concept color=mmcolor7,level distance=4.2cm]{ node[concept,scale=1.0,font=\normalsize] {Pyyyyy YYYYY Yyyyyyyyyy}
        child [grow=0,concept color=red,level distance=4cm]{%
        node[concept,scale=1.4,font=\tiny] {Piiiiiiiiiiii Mmmmmmm}}
    };

\newcommand{\ca}{to[circle connection bar switch color=from (mmcolor2) to (mmcolor2)]}
\newcommand{\cb}{to[circle connection bar switch color=from (mmcolor2) to (mmcolor21)]}
\newcommand{\cc}{to[circle connection bar switch color=from (mmcolor5) to (mmcolor5)]}
\newcommand{\cd}{to[circle connection bar switch color=from (mmcolor5) to (mmcolor6)]}
\newcommand{\ce}{to[circle connection bar switch color=from (mmcolor4) to (mmcolor4)]}
\newcommand{\cf}{to[circle connection bar switch color=from (mmcolor4) to (mmcolor6)]}

\begin{pgfonlayer}{background}
      \path (gooooo) \cb (suuuuuuuuuuuuu);
      \path (aaaa) \ca (gooooo);
      \path (bbb) \ca (gooooo);
      \path (nnnn) \ca (gooooo);
      \path (pyyy) \cb (suuuuuuuuuuuuu);
      \path (reeeeee) \ce (pssssssss);
      \path (coooooooo) \ce (pssssssss);
      \path (nbbbb) \ce (pssssssss);
      \path (eee) \cc (oppppp);
      \path (ppp) \cc (oppppp);
      \path (yyyyyyyy) \cd (lsl);
      \path (oppppp) \cd (lsl);
      \path (pssssssss) \cf (lsl);
  \end{pgfonlayer}

\end{tikzpicture}
}
\caption{Big system to describe.}
\end{figure}
\end{document}

根据 @jet 的建议,执行上面的代码,我得到了一条围绕蓝色部分的漂亮路径,即 with\draw命令。我认为现在我直观地验证了要剪切的区域,我只需用 替换\draw即可\clip。但实际上我从其他节点获得了一些关节:

这是带有命令的图片\draw,接下来是带有\clip命令的图片: 在此处输入图片描述 在此处输入图片描述

我认为问题可能出在 tikzpicture 的最后一部分pgfonlayer。我只是用它将深蓝色节点(不是主节点的子节点)链接到其他节点。我不知道还有其他方法可以做到这一点。我不想剪辑/修剪 pdf,因为我想让节点保持可引用。

答案1

我还是不明白背景层是干什么用的!?

我只是将其删除并启用剪辑:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{tikz}
\usetikzlibrary{mindmap,shadows}

\begin{document}
\begin{figure}[ht]
\centering
\resizebox{0.8\textwidth}{!}{
\begin{tikzpicture}
\colorlet{mmcolor1}{green!50!black}
\definecolor{mmcolor2}{HTML}{673AB7}
\colorlet{mmcolor21}{red!50!black}
\colorlet{mmcolor3}{red!40}
\definecolor{mmcolor4}{HTML}{3380FF}
\colorlet{mmcolor5}{orange}
\colorlet{mmcolor6}{blue}
\colorlet{mmcolor7}{blue!80!white!60!green}

\coordinate (a) at (8.2,7.5);
\coordinate (b) at (6,7.5);
\coordinate (c) at (2.1,5);
\coordinate (d) at (2.1,-1.5);
\coordinate (e) at (6,-3.6);
\coordinate (f) at (8.2,-3.6);

%\draw (a)--(b)--(c)--(d)--(e)--(f)--cycle;
\clip (a)--(b)--(c)--(d)--(e)--(f)--cycle; %The problem is here


\path[mindmap, concept color=mmcolor1, text=white]
    node [concept] {\textbf{Central\\ Node\\ with a big\\ title.}}%
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    child [grow = 90,concept color=mmcolor2]{
      node[concept] {Sablabla Measurements}
      child [grow = 180, level distance=3.6cm]{ node[concept](aaaa)    {AAAA} }
      child [grow = 135]{ node[concept](bbb)     {BBB}  }
      child [grow = 90] { node[concept](nnnn) {NNNN}
        child [grow = -30] {node[concept,font=\normalsize] (pyyy) {pyyy Yyy}} }
    }%
    %%%%%%%%%%%%%%%%%%%%%%%%%%
    child [grow=180,concept color=mmcolor3]{
    node[concept] {Pablablablabla Measurements}
        child [grow=90]{
        node[concept,scale=1.2,font=\tiny] {Pablablablabla Mmmmmmm} }
    }%
    %%%%%%%%%%%%%%%%%%%%%%%%%%
    child [concept color=mmcolor4, grow=45]{
      node[concept] {Immmmmmmmmm Tiiiii}
      child [grow=0, level distance=3.4cm] { node[concept](reeeeee){reeeeee}
        child [grow=90,text width=1.5cm]{
        node[concept,font=\footnotesize] {Hhhhhhhh\\ Aaaaaaa} }}
      child [grow=-45]{ node[concept](coooooooo) {coooooooo} }
      child [grow=-90]{ node[concept](nbbbb) {Nbbbbb} }
    }%
    %%%%%%%%%%%%%%%%%%%%%%%%%%
    child [concept color=mmcolor5, grow=-140] {%
      node[concept] {Piiiiiiiiiii Peeeeeeeeeeee}
      child [grow=-45]  { node[concept](eee) {BBBB (eee)} }
      child [grow=-90,level distance=3.3cm]  { node[concept](ppp) {HHHHH (ppp)} }
      child [grow=0]    { node[concept](yyyyyyyy) {YYYY\\(yyy-yyyyyyy)} }
    };

%%%%%%%%%%%% 
\path[mindmap,concept color=mmcolor2, text=white]
    node[concept,scale=0.5,font=\huge](gooooo) at (-3,10){Gooooo\\ foooo};

%%%%%%%%%%%% 
\path[mindmap,concept color=mmcolor21, text=white]
    node[concept,scale=0.5,font=\huge](suuuuuuuuuuuuu) at (2,10){Suuuuuuuu Meeeeee};

%%%%%%%%%%%% 
\path[mindmap,concept color=mmcolor4, text=white]
    node[concept,scale=0.5,font=\huge](pssssssss) at (7,-2){pssssssss};

%%%%%%%%%%%%
\path[mindmap,concept color=mmcolor5, text=white]
    node[concept,scale=0.5,font=\huge](oppppp) at (0.7,-6.5){oppppp\\ Cyyyy};

%%%%%%%%%%%%
\path[mindmap,concept color=blue, text=white]%
    node[concept,scale=0.5,font=\huge](lsl) at (3.5,-4){Laa\\ Aaaaaaaa\\ Aaaaa}
    child [grow=-30,concept color=mmcolor7,level distance=3.3cm]{%
    node[concept,scale=0.8,font=\small] {Opppp Live}}
    child [grow=-90,concept color=mmcolor7,level distance=4.2cm]{ node[concept,scale=1.0,font=\normalsize] {Pyyyyy YYYYY Yyyyyyyyyy}
        child [grow=0,concept color=red,level distance=4cm]{%
        node[concept,scale=1.4,font=\tiny] {Piiiiiiiiiiii Mmmmmmm}}
    };

\newcommand{\ca}{to[circle connection bar switch color=from (mmcolor2) to (mmcolor2)]}
\newcommand{\cb}{to[circle connection bar switch color=from (mmcolor2) to (mmcolor21)]}
\newcommand{\cc}{to[circle connection bar switch color=from (mmcolor5) to (mmcolor5)]}
\newcommand{\cd}{to[circle connection bar switch color=from (mmcolor5) to (mmcolor6)]}
\newcommand{\ce}{to[circle connection bar switch color=from (mmcolor4) to (mmcolor4)]}
\newcommand{\cf}{to[circle connection bar switch color=from (mmcolor4) to (mmcolor6)]}

      \path (gooooo) \cb (suuuuuuuuuuuuu);
      \path (aaaa) \ca (gooooo);
      \path (bbb) \ca (gooooo);
      \path (nnnn) \ca (gooooo);
      \path (pyyy) \cb (suuuuuuuuuuuuu);
      \path (reeeeee) \ce (pssssssss);
      \path (coooooooo) \ce (pssssssss);
      \path (nbbbb) \ce (pssssssss);
      \path (eee) \cc (oppppp);
      \path (ppp) \cc (oppppp);
      \path (yyyyyyyy) \cd (lsl);
      \path (oppppp) \cd (lsl);
      \path (pssssssss) \cf (lsl);

\end{tikzpicture}
}
\caption{Big system to describe.}
\end{figure}
\end{document}

并给出: 剪裁图

我不知道这是不是您想要的结果?或者这是有问题的输出?

答案2

你可以剪辑思维导图的一部分,例如\clip (2.1,-3) rectangle (10,6.8);(pgfmanual v3.1.5bp 84, 6.3 创建讲座地图)

在此处输入图片描述

然后在带有figure标题的article

在此处输入图片描述

我把你的放在tikzpicture一个standalone文件中。

foo.tex

\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{tikz}
\usetikzlibrary{mindmap,shadows,backgrounds}
\usepackage{xcolor}

\begin{document}
\begin{tikzpicture}
 \colorlet{mmcolor1}{green!50!black}
 \definecolor{mmcolor2}{HTML}{673AB7}
 \colorlet{mmcolor21}{red!50!black}
 \colorlet{mmcolor3}{red!40}
 \definecolor{mmcolor4}{HTML}{3380FF}
 \colorlet{mmcolor5}{orange}
 \colorlet{mmcolor6}{blue}
 \colorlet{mmcolor7}{blue!80!white!60!green}

%% here you clip %%
%\clip (2.3,-3) rectangle (10,6.8);
% I define manually the coordinates if the path I want to clip
\coordinate (a) at (2.3,-1);
\coordinate (b) at (5,-3);
\coordinate (c) at (8.5,-3);
\coordinate (d) at (8.5,7.8);
\coordinate (e) at (2.0,4.0);

\clip   (a) -- (b) -- (c) -- (d) --  (e) --cycle; 

\path[mindmap, concept color=mmcolor1, text=white]
    node [concept] {\textbf{Central\\ Node\\ with a big\\ title.}}%
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    child [grow = 90,concept color=mmcolor2]{
      node[concept] {Sablabla Measurements}
      child [grow = 180, level distance=3.6cm]{ node[concept](aaaa)    {AAAA} }
      child [grow = 135]{ node[concept](bbb)     {BBB}  }
      child [grow = 90] { node[concept](nnnn) {NNNN}
        child [grow = -30] {node[concept,font=\normalsize] (pyyy) {pyyy Yyy}} }
    }%
    %%%%%%%%%%%%%%%%%%%%%%%%%%
    child [grow=180,concept color=mmcolor3]{
    node[concept] {Pablablablabla Measurements}
        child [grow=90]{
        node[concept,scale=1.2,font=\tiny] {Pablablablabla Mmmmmmm} }
    }%
    %%%%%%%%%%%%%%%%%%%%%%%%%%
    child [concept color=mmcolor4, grow=45]{
      node[concept] {Immmmmmmmmm Tiiiii}
      child [grow=0, level distance=3.4cm] { node[concept](reeeeee){reeeeee}
        child [grow=90,text width=1.5cm]{
        node[concept,font=\footnotesize] {Hhhhhhhh\\ Aaaaaaa} }}
      child [grow=-45]{ node[concept](coooooooo) {coooooooo} }
      child [grow=-90]{ node[concept](nbbbb) {Nbbbbb} }
    }%
    %%%%%%%%%%%%%%%%%%%%%%%%%%
    child [concept color=mmcolor5, grow=-140] {%
      node[concept] {Piiiiiiiiiii Peeeeeeeeeeee}
      child [grow=-45]  { node[concept](eee) {BBBB (eee)} }
      child [grow=-90,level distance=3.3cm]  { node[concept](ppp) {HHHHH (ppp)} }
      child [grow=0]    { node[concept](yyyyyyyy) {YYYY\\(yyy-yyyyyyy)} }
    };

%%%%%%%%%%%% 
\path[mindmap,concept color=mmcolor2, text=white]
    node[concept,scale=0.5,font=\huge](gooooo) at (-3,10){Gooooo\\ foooo};

%%%%%%%%%%%% 
\path[mindmap,concept color=mmcolor21, text=white]
    node[concept,scale=0.5,font=\huge](suuuuuuuuuuuuu) at (2,10){Suuuuuuuu Meeeeee};

%%%%%%%%%%%% 
\path[mindmap,concept color=mmcolor4, text=white]
    node[concept,scale=0.5,font=\huge](pssssssss) at (7,-2){pssssssss};

%%%%%%%%%%%%
\path[mindmap,concept color=mmcolor5, text=white]
    node[concept,scale=0.5,font=\huge](oppppp) at (0.7,-6.5){oppppp\\ Cyyyy};

%%%%%%%%%%%%
\path[mindmap,concept color=blue, text=white]%
    node[concept,scale=0.5,font=\huge](lsl) at (3.5,-4){Laa\\ Aaaaaaaa\\ Aaaaa}
    child [grow=-30,concept color=mmcolor7,level distance=3.3cm]{%
    node[concept,scale=0.8,font=\small] {Opppp Live}}
    child [grow=-90,concept color=mmcolor7,level distance=4.2cm]{ node[concept,scale=1.0,font=\normalsize] {Pyyyyy YYYYY Yyyyyyyyyy}
        child [grow=0,concept color=red,level distance=4cm]{%
        node[concept,scale=1.4,font=\tiny] {Piiiiiiiiiiii Mmmmmmm}}
    };

\newcommand{\ca}{to[circle connection bar switch color=from (mmcolor2) to (mmcolor2)]}
\newcommand{\cb}{to[circle connection bar switch color=from (mmcolor2) to (mmcolor21)]}
\newcommand{\cc}{to[circle connection bar switch color=from (mmcolor5) to (mmcolor5)]}
\newcommand{\cd}{to[circle connection bar switch color=from (mmcolor5) to (mmcolor6)]}
\newcommand{\ce}{to[circle connection bar switch color=from (mmcolor4) to (mmcolor4)]}
\newcommand{\cf}{to[circle connection bar switch color=from (mmcolor4) to (mmcolor6)]}

\begin{pgfonlayer}{background}
      \path (gooooo) \cb (suuuuuuuuuuuuu);
      \path (aaaa) \ca (gooooo);
      \path (bbb) \ca (gooooo);
      \path (nnnn) \ca (gooooo);
      \path (pyyy) \cb (suuuuuuuuuuuuu);
      \path (reeeeee) \ce (pssssssss);
      \path (coooooooo) \ce (pssssssss);
      \path (nbbbb) \ce (pssssssss);
      \path (eee) \cc (oppppp);
      \path (ppp) \cc (oppppp);
      \path (yyyyyyyy) \cd (lsl);
      \path (oppppp) \cd (lsl);
      \path (pssssssss) \cf (lsl);
  \end{pgfonlayer}

\end{tikzpicture}%

\end{document}

您可以通过调用来输入文章

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{tikz}
\usetikzlibrary{mindmap}
%\usepackage{xcolor}
\usepackage{standalone}  %Load standalone

\begin{document}
\begin{figure}[ht]  %\ was missing
\centering
\includegraphics[width=0.5\textwidth]{foo.pdf}
\caption{Big system to describe.}
\end{figure}
\end{document}

相关内容