0

I want to create a mindmap on top of a select image. So far I've tried the following code, but it creates only the background image, and does not draw the the mindmap. Any ideas?

\begin{document}

\begin{tikzpicture}[ every annotation/.style = {draw,
                     fill = white, font = \Large}]
  \path[mindmap,concept color=black!40,text=white,
    every node/.style={concept,circular drop shadow},
    root/.style    = {concept color=black!40,
      font=\large\bfseries,text width=10em},
    level 1 concept/.append style={font=\Large\bfseries,
      sibling angle=45,text width=7.7em,
    level distance=40em,inner sep=0pt},
    level 2 concept/.append style={font=\bfseries,level distance=15em},
  ]



node[anchor=south west,inner sep=0] at (0,0) {\includegraphics[width=\textwidth]{/Users/Dms/Pictures/vein.png}};



  node[root, concept, ball color = gray, scale = 2] {\huge ROOT_NODE}} [clockwise from=0]


    child[concept color=blue!60] {
      node [concept, ball color=blue!60, scale = 1.5]{NODE_1} [clockwise from=90]
        child { node [concept, ball color=blue!60, scale = 1.5] (CHILD1)}
        child { node [concept, ball color=blue!60, scale = 1.5] (CHILD2)}
    }

\end{tikzpicture}


\end{document}
2

You have several errors in your code.

  1. The semicolon after the node with the background image ends the \path command, so no mind map commands are executed; remove the semicolon.
  2. You need a backslash in front of the underscores: ROOT\_NODE, NODE\_1.
  3. The labels of the last nodes have to be enclosed in braces, not parentheses: {CHILD1}, {CHILD2}.
  4. There is an extra } after ROOT\_NODE, remove it.
  5. There is a semicolon missing at the end of the \path command.

If I replace your image by example-image, your code compiles, but the dimensions and sizes don't fit. The background image is hardly visible behind the root node, and the mind map extends beyond reasonable pages, which is not surprising with distances like 40em. (Note that I use the class standalone which makes the page as big as needed; try article, and only the root node will be left on the page.)

I recommend to start anew, adding only one element at a time and adjusting it until it fits before adding more.

enter image description here

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{mindmap,shadows}
\begin{document}
\begin{tikzpicture}[ every annotation/.style = {draw,
                     fill = white, font = \Large}]
  \path[mindmap,concept color=black!40,text=white,
    every node/.style={concept,circular drop shadow},
    root/.style    = {concept color=black!40,
      font=\large\bfseries,text width=10em},
    level 1 concept/.append style={font=\Large\bfseries,
      sibling angle=45,text width=7.7em,
    level distance=40em,inner sep=0pt},
    level 2 concept/.append style={font=\bfseries,level distance=15em},
  ]


node[anchor=south west,inner sep=0] at (0,0) {\includegraphics[width=\textwidth]{example-image}}



  node[root, concept, ball color = gray, scale = 2] {\huge ROOT\_NODE} [clockwise from=0]


    child[concept color=blue!60] {
      node [concept, ball color=blue!60, scale = 1.5]{NODE\_1} [clockwise from=90]
        child { node [concept, ball color=blue!60, scale = 1.5] {CHILD1}}
        child { node [concept, ball color=blue!60, scale = 1.5] {CHILD2}}
    };

\end{tikzpicture}


\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.