思维导图无法在我的 Beamer 演示文稿中正确显示

思维导图无法在我的 Beamer 演示文稿中正确显示

我正在我的 Beamer 演示文稿中制作思维导图。思维导图要么忽略所有元素,让grow cyclic所有元素都位于思维导图的右侧/东侧,要么兄弟元素始终向东对齐,而不是像树一样循环生长。

我希望我的思维导图看起来有点像这样:

在此处输入图片描述

相反,输出(来自下面的代码)如下所示:

在此处输入图片描述

\documentclass{beamer}
\usepackage{xcolor}

\usepackage{tikz}
\usetikzlibrary{mindmap}
\tikzset{
    invisible/.style={opacity=0},
    visible on/.style={alt=#1{}{invisible}},
    alt/.code args={<#1>#2#3}{%
      \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}
    }
}

\makeatletter
\tikzoption{myball color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{myball}\tikz@addmode{\tikz@mode@shadetrue}}
\tikzoption{myball-left color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{myball-left}\tikz@addmode{\tikz@mode@shadetrue}}
\tikzoption{myball-right color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{myball-right}\tikz@addmode{\tikz@mode@shadetrue}}
\tikzoption{myball-lefttop color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{myball-lefttop}\tikz@addmode{\tikz@mode@shadetrue}}
\tikzoption{myball-righttop color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{myball-righttop}\tikz@addmode{\tikz@mode@shadetrue}}
\tikzoption{myball-top color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{myball-top}\tikz@addmode{\tikz@mode@shadetrue}}
\pgfdeclareradialshading[tikz@ball]{myball}{\pgfqpoint{5bp}{10bp}}{%
 color(0bp)=(tikz@ball!30!white);
 color(9bp)=(tikz@ball!75!white);
 color(18bp)=(tikz@ball!90!black);
 color(25bp)=(tikz@ball!70!black);
 color(50bp)=(black)}
 \pgfdeclareradialshading[tikz@ball]{myball-left}{\pgfqpoint{5bp}{-9bp}}{%
 color(0bp)=(tikz@ball!30!white);
 color(15bp)=(tikz@ball!75!white);
 color(25bp)=(tikz@ball!90!black);
 color(40bp)=(tikz@ball!70!black);
 color(70bp)=(black)}
\pgfdeclareradialshading[tikz@ball]{myball-right}{\pgfqpoint{-5bp}{-9bp}}{%
 color(0bp)=(tikz@ball!30!white);
 color(15bp)=(tikz@ball!75!white);
 color(25bp)=(tikz@ball!90!black);
 color(40bp)=(tikz@ball!70!black);
 color(70bp)=(black)} 
 \pgfdeclareradialshading[tikz@ball]{myball-lefttop}{\pgfqpoint{3bp}{7bp}}{%
 color(0bp)=(tikz@ball!30!white);
 color(15bp)=(tikz@ball!75!white);
 color(25bp)=(tikz@ball!90!black);
 color(40bp)=(tikz@ball!70!black);
 color(70bp)=(black)}
\pgfdeclareradialshading[tikz@ball]{myball-righttop}{\pgfqpoint{-3bp}{7bp}}{%
 color(0bp)=(tikz@ball!30!white);
 color(15bp)=(tikz@ball!75!white);
 color(25bp)=(tikz@ball!90!black);
 color(40bp)=(tikz@ball!70!black);
 color(70bp)=(black)} 
\pgfdeclareradialshading[tikz@ball]{myball-top}{\pgfqpoint{0bp}{11bp}}{%
 color(0bp)=(tikz@ball!30!white);
 color(15bp)=(tikz@ball!75!white);
 color(25bp)=(tikz@ball!90!black);
 color(40bp)=(tikz@ball!70!black);
 color(70bp)=(black)} 
\makeatother
\tikzset{level 1 concept/.append style={font=\sf, level distance = 25mm,sibling angle=60}}
\tikzset{level 2 concept/.append style={font=\sf, level distance = 18mm,sibling angle=40}}
\tikzset{level 3 concept/.append style={font=\sf, level distance = 14mm,sibling angle=30}}
\tikzset{mynode/.style={scale=.25}}


\begin{document}
\begin{frame}{}
\centering
\begin{tikzpicture}[mindmap, concept color=red, font=\sf\bf, text=white,scale=0.6, grow cyclic]
\node[concept,mynode,circle,shading=myball,visible on=<1->]{Circulair economie}[clockwise from=45]
    child [sibling angle=250, concept color=orange,visible on=<10->] {node[mynode,circle, myball-top color=orange] (c1){21ste eeuwse verlichting}                                
        child[visible on=<11->]  {node [mynode,circle, myball-left color=orange](c11){Lineaire systemen}}
        child[visible on=<11->]  {node [mynode,circle,myball-left color=orange](c12){Non-lineaire systemen}}
        child[visible on=<11->]  {node [mynode,circle,myball-left color=orange](c13){Inspiratie biosfeer}}                                                   
        child[visible on=<11->]  {node [mynode,circle,myball-left color=orange](c14){Systeemdenken}}
     }
     child [concept color=violet,visible on=<2->]{node [mynode,circle,myball-righttop color=violet, sibling angle=250](c2){Life, Design, Intention}
        child[visible on=<3->] {node [mynode,circle,myball-right color=violet](c21){Biologische cycli}}
        child[visible on=<3->] {node [mynode,circle,myball-right color=violet](c22){Technische cycli}}
        child[visible on=<3->] {node [mynode,circle,myball-right color=violet](c23){Cradle-to-Cradle}}
        child[visible on=<3->] {node [mynode,circle,myball-right color=violet](c24){Whole-systems}}
    }
    child [concept color=blue,visible on=<4->]{node [mynode,circle,myball-right color=violet, clockwise from=250](c3){Energie, materialen}
        child[visible on=<5->] {node [mynode,circle,myball-right color=violet](c31){Energietrends}}
        child[visible on=<5->] {node [mynode,circle,myball-right color=violet](c32){Energie \& Voedsel}}
        child[visible on=<5->] {node [mynode,circle,myball-right color=violet](c33){Slimmere distributie energie}}
        child[visible on=<5->] {node [mynode,circle,myball-right color=violet](c34){Veerkrachtigheid versus efficiëntie}}
        child[visible on=<5->] {node [mynode,circle,myball-right color=violet](c35){Cascading}}
    }
    child [concept color=red,visible on=<6->]{node [mynode,circle,myball-left color=violet](c4){Producten en services}
        child[visible on=<7->] {node [mynode,circle,myball-right color=violet](c41){Circulair design}}
        child[visible on=<7->] {node [mynode,circle,myball-right color=violet](c42){Gebruiker versus consument}}
        child[visible on=<7->] {node [mynode,circle,myball-right color=violet](c43){Design for disassembly}}
        child[visible on=<7->] {node [mynode,circle,myball-right color=violet](c44){Circular financing}}
    }
    child [concept color=yellow,visible on=<8->]{node [mynode,circle,myball-lefttop color=violet](c5){Prijssystemen}
        child[visible on=<9->] {node [mynode,circle,myball-right color=violet](c51){Geld versus goed}}
        child[visible on=<9->] {node [mynode,circle,myball-right color=violet](c52){Belasting en subsidies}}
        child[visible on=<9->] {node [mynode,circle,myball-right color=violet](c53){Welzijn en groei}}
    };
\end{tikzpicture}
\end{frame}

\end{document}

答案1

一个完整的解决方案。有很多clockwise from=xx需要删除的内容。此外,删除了单独的兄弟 angle=xx,并由通过以下方式自动分配 1 级兄弟来代替

sibling angle=360/\the\tikznumberofchildren

这样 1 级兄弟节点就可以均匀分配。

在此处输入图片描述 在此处输入图片描述 在此处输入图片描述

代码

\documentclass{beamer}
\usepackage{xcolor}

\usepackage{tikz}
\usetikzlibrary{mindmap,calc}
\tikzset{
    invisible/.style={opacity=0},
    visible on/.style={alt=#1{}{invisible}},
    alt/.code args={<#1>#2#3}{%
      \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}
    },
}

\makeatletter
\tikzoption{myball color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{myball}\tikz@addmode{\tikz@mode@shadetrue}}
\tikzoption{myball-left color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{myball-left}\tikz@addmode{\tikz@mode@shadetrue}}
\tikzoption{myball-right color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{myball-right}\tikz@addmode{\tikz@mode@shadetrue}}
\tikzoption{myball-lefttop color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{myball-lefttop}\tikz@addmode{\tikz@mode@shadetrue}}
\tikzoption{myball-righttop color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{myball-righttop}\tikz@addmode{\tikz@mode@shadetrue}}
\tikzoption{myball-top color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{myball-top}\tikz@addmode{\tikz@mode@shadetrue}}
\pgfdeclareradialshading[tikz@ball]{myball}{\pgfqpoint{5bp}{10bp}}{%
 color(0bp)=(tikz@ball!30!white);
 color(9bp)=(tikz@ball!75!white);
 color(18bp)=(tikz@ball!90!black);
 color(25bp)=(tikz@ball!70!black);
 color(50bp)=(black)}
 \pgfdeclareradialshading[tikz@ball]{myball-left}{\pgfqpoint{5bp}{-9bp}}{%
 color(0bp)=(tikz@ball!30!white);
 color(15bp)=(tikz@ball!75!white);
 color(25bp)=(tikz@ball!90!black);
 color(40bp)=(tikz@ball!70!black);
 color(70bp)=(black)}
\pgfdeclareradialshading[tikz@ball]{myball-right}{\pgfqpoint{-5bp}{-9bp}}{%
 color(0bp)=(tikz@ball!30!white);
 color(15bp)=(tikz@ball!75!white);
 color(25bp)=(tikz@ball!90!black);
 color(40bp)=(tikz@ball!70!black);
 color(70bp)=(black)} 
 \pgfdeclareradialshading[tikz@ball]{myball-lefttop}{\pgfqpoint{3bp}{7bp}}{%
 color(0bp)=(tikz@ball!30!white);
 color(15bp)=(tikz@ball!75!white);
 color(25bp)=(tikz@ball!90!black);
 color(40bp)=(tikz@ball!70!black);
 color(70bp)=(black)}
\pgfdeclareradialshading[tikz@ball]{myball-righttop}{\pgfqpoint{-3bp}{7bp}}{%
 color(0bp)=(tikz@ball!30!white);
 color(15bp)=(tikz@ball!75!white);
 color(25bp)=(tikz@ball!90!black);
 color(40bp)=(tikz@ball!70!black);
 color(70bp)=(black)} 
\pgfdeclareradialshading[tikz@ball]{myball-top}{\pgfqpoint{0bp}{11bp}}{%
 color(0bp)=(tikz@ball!30!white);
 color(15bp)=(tikz@ball!75!white);
 color(25bp)=(tikz@ball!90!black);
 color(40bp)=(tikz@ball!70!black);
 color(70bp)=(black)} 
\makeatother
\tikzset{level 1 concept/.append style={font=\sf, level distance = 25mm,sibling angle=360/\the\tikznumberofchildren}}
\tikzset{level 2 concept/.append style={font=\sf, level distance = 18mm,sibling angle=40}}
\tikzset{level 3 concept/.append style={font=\sf, level distance = 14mm,sibling angle=30}}
\tikzset{mynode/.style={scale=.25}}


\begin{document}
\begin{frame}{}
\centering
\begin{tikzpicture}[mindmap, concept color=red, font=\sf\bf, text=white,scale=0.6, grow cyclic
]
\node[concept,mynode,circle,shading=myball,visible on=<1->
]{Circulair economie}[]%clockwise from=45]
    child [concept color=orange,visible on=<10->
] {node[mynode,circle, myball-top color=orange] (c1){21ste eeuwse verlichting}                                
        child[visible on=<11->
]  {node [mynode,circle, myball-left color=orange](c11){Lineaire systemen}}
        child[visible on=<11->
]  {node [mynode,circle,myball-left color=orange](c12){Non-lineaire systemen}}
        child[visible on=<11->
]  {node [mynode,circle,myball-left color=orange](c13){Inspiratie biosfeer}}                                                   
        child[visible on=<11->
]  {node [mynode,circle,myball-left color=orange](c14){Systeemdenken}}
     }
     child [concept color=violet,visible on=<2->
]{node [mynode,circle,myball-righttop color=violet](c2){Life, Design, Intention}
        child[visible on=<3->
] {node [mynode,circle,myball-right color=violet](c21){Biologische cycli}}
        child[visible on=<3->
] {node [mynode,circle,myball-right color=violet](c22){Technische cycli}}
        child[visible on=<3->
] {node [mynode,circle,myball-right color=violet](c23){Cradle-to-Cradle}}
        child[visible on=<3->
] {node [mynode,circle,myball-right color=violet](c24){Whole-systems}}
    }  % ----------------
    child [concept color=blue,visible on=<4->
]{node [mynode,circle,myball-right color=violet](c3){Energie, materialen}
        child[visible on=<5->
] {node [mynode,circle,myball-right color=violet](c31){Energietrends}}
        child[visible on=<5->
] {node [mynode,circle,myball-right color=violet](c32){Energie \& Voedsel}}
        child[visible on=<5->
] {node [mynode,circle,myball-right color=violet](c33){Slimmere distributie energie}}
        child[visible on=<5->
] {node [mynode,circle,myball-right color=violet](c34){Veerkrachtigheid versus efficiëntie}}
        child[visible on=<5->
] {node [mynode,circle,myball-right color=violet](c35){Cascading}}
    }   %----------
    child [concept color=red,visible on=<6->
]{node [mynode,circle,myball-left color=violet](c4){Producten en services}
        child[visible on=<7->
] {node [mynode,circle,myball-right color=violet](c41){Circulair design}}
        child[visible on=<7->
] {node [mynode,circle,myball-right color=violet](c42){Gebruiker versus consument}}
        child[visible on=<7->
] {node [mynode,circle,myball-right color=violet](c43){Design for disassembly}}
        child[visible on=<7->
] {node [mynode,circle,myball-right color=violet](c44){Circular financing}}
    }
    child [concept color=yellow,visible on=<8->
]{node [mynode,circle,myball-lefttop color=violet](c5){Prijssystemen}
        child[visible on=<9->
] {node [mynode,circle,myball-right color=violet](c51){Geld versus goed}}
        child[visible on=<9->
] {node [mynode,circle,myball-right color=violet](c52){Belasting en subsidies}}
        child[visible on=<9->
] {node [mynode,circle,myball-right color=violet](c53){Welzijn en groei}}
};
\end{tikzpicture}
\end{frame}

\end{document}

答案2

只需删除[clockwise from=45]即可解决主要问题:

表现更好的思维导图

相关内容