3

Question 1

I would like to make the edge to the blue nodes longer, I just really want to be able to modify and I tried a billion things from stackexchange (from changing the paperheight to adding level 2 and level3 concept/.append style with all kinds of different level distances and inner sep) but nothing helped:

\PassOptionsToPackage{table}{xcolor}
\documentclass{article}
\usepackage{tikz,times}
\usepackage[paperwidth=30cm,paperheight=50cm,right=.5cm,top=10cm] 
{geometry} 

\usetikzlibrary{mindmap,trees}

 \definecolor{mypink3}{cmyk}{0, 0.7808, 0.4429, 0.1412}
 \definecolor{yel}{rgb}{0.898, 0.6196, 0.14}
 \definecolor{blue1}{rgb}{0.11, 0.5, 0.9}

\pagestyle{empty}

\begin{document}


\begin{tikzpicture}[mindmap,every node/.append style={font=\large},
   level 1 concept/.append style={level distance=230,sibling angle=30}] 


 \node [concept, ball color=yel!90!black,  inner sep=50] (Central) 
{Central}[counterclockwise from=90] 

     child {node [concept, ball color=mypink3!90!black, inner sep=10] 
(Leymebamba) {Leymebamba}
            child[grow=75] {node [concept, ball color=blue1!90!black, inner sep=5] (Pacasmayo) {Pacasmayo}} 
            child[grow=75, clockwise from=45] {node [concept, ball color=blue1!90!black, inner sep=5] (Huari) {Huari}} 
             }
     child {node [concept, ball color=mypink3!90!black, inner sep=10] (Chancay) {Chancay}
            child{node [concept, ball color=blue1!90!black, inner sep=5] (Huacho) {Huacho}}
            };


  \path 
    (Central) to[circle connection bar switch color=from (yel!90!black) to (mypink3!90!black)] (Leymebamba);
             \path 
            (Leymebamba) to[circle connection bar switch color=from (mypink3!90!black) to (blue1!90!black)] (Pacasmayo);
             \path 
            (Leymebamba) to[circle connection bar switch color=from (mypink3!90!black) to (blue1!90!black)] (Huari);
\path 
    (Central) to[circle connection bar switch color=from (yel!90!black) to (mypink3!90!black)] (Chancay);

 \path 
       (Chancay) to[circle connection bar switch color=from 
(mypink3!90!black) to (blue1!90!black)] (Huacho);
    \end{tikzpicture}

\end{document}

Which produces this picture:

enter image description here

Thank you!

Question 2

I would like to place 5 more red nodes (are the called level 2?) and I only want to place everything on the left side of the circle, using a mindmap example from this Stackoverflow question , here is basically what I would like it to look like, how do I do that with my mindmap above (tried changing sibling angles, rotation starting point, like "counterclockwise from=90" and nothing works, it keeps going 360 degrees:

enter image description here

1
  • 1
    Welcome! It is generally better to ask one question per question. It encourages answers to one question by people who can't or don't want to answer both and avoids situations where you must choose between two answers which is the most helpful, when each did half the job. It also makes it easier to search the site and for other users to tell if your question is relevant to their problem.
    – cfr
    Commented May 27, 2018 at 2:52

1 Answer 1

3

The key problem in your code is that you do not construct the mind-map as a single path, try to apply mindmap to the tikzpicture. Moreover, you don't need to draw the connections manually unless you need non-standard edges, which you don't here.

Here's code which illustrates a solution to the problem posed in Question 1. Question 2 should be a new question, according to the one-question-per-question rule.

\documentclass[border=10pt]{standalone}
\usepackage{tikz,tgtermes}% times is deprecated - use one of the other options
\usetikzlibrary{mindmap,trees}
\definecolor{mypink3}{cmyk}{0, 0.7808, 0.4429, 0.1412}
\definecolor{yel}{rgb}{0.898, 0.6196, 0.14}
\definecolor{blue1}{rgb}{0.11, 0.5, 0.9}

\begin{document}
\begin{tikzpicture} 
  \path [
    mindmap,
    every node/.append style={text=white},
    level 1 concept/.append style={level distance=230, sibling angle=30, font=\large\sffamily\bfseries},
    level 2 concept/.append style={level distance=100, sibling angle=30, font=\sffamily\bfseries},
    concept color=yel!90!black,
  ]
  node [concept, font=\Huge\sffamily\bfseries, ball color=yel!90!black,  inner sep=50] (Central) {Central}[counterclockwise from=90] 

  child [concept color=mypink3!90!black] {
    node [concept, inner sep=10, ball color=mypink3!90!black] (Leymebamba) {Leymebamba}
    child[grow=75, concept color=blue1!90!black] {
      node [concept,  inner sep=5, ball color=blue1!90!black] (Pacasmayo) {Pacasmayo}
    } 
    child [grow=75, clockwise from=45, concept color=blue1!90!black ] {
      node [concept, inner sep=5, ball color=blue1!90!black] (Huari) {Huari}
    }
  }
  child [concept color=mypink3!90!black] {
    node [concept,  inner sep=10, ball color=mypink3!90!black] (Chancay) {Chancay}
    child [concept color=blue1!90!black] {
      node [concept, inner sep=5, ball color=blue1!90!black] (Huacho) {Huacho}
    }
  };
\end{tikzpicture}
\end{document}

This is a genuine mind-map rather than just using some of the styles provided by the library: note that mindmap is passed as an option to the whole \path and that the first node is part of this path i.e. everything comes within the scope of the path's mindmap. You don't need to pass this to the whole picture and it doesn't do any good doing so.

Once this is set up correctly, the styles for different levels work as expected, the connectors are drawn automatically and things start to fall into place ....

genuine mind-map


Although it shouldn't be here ...

\documentclass[border=10pt]{standalone}
\usepackage{tikz,tgtermes}% times is deprecated - use one of the other options
\usetikzlibrary{mindmap,trees}
\definecolor{mypink3}{cmyk}{0, 0.7808, 0.4429, 0.1412}
\definecolor{yel}{rgb}{0.898, 0.6196, 0.14}
\definecolor{blue1}{rgb}{0.11, 0.5, 0.9}

\begin{document}
\begin{tikzpicture} 
  \path [
    mindmap,
    every node/.append style={text=white},
    level 1 concept/.append style={level distance=230, sibling angle=30, font=\large\sffamily\bfseries},
    level 2 concept/.append style={level distance=100, font=\sffamily\bfseries},
    concept color=yel!90!black,
  ]
  node [concept, font=\Huge\sffamily\bfseries, ball color=yel!90!black,  inner sep=50] (Central) {Central}[counterclockwise from=90] 

  child [concept color=mypink3!90!black] {
    node [concept, inner sep=10, ball color=mypink3!90!black] (Leymebamba) {Leymebamba}
    child[grow=75, concept color=blue1!90!black] {
      node [concept,  inner sep=5, ball color=blue1!90!black] (Pacasmayo) {Pacasmayo}
    } 
    child [grow=75, clockwise from=45, concept color=blue1!90!black ] {
      node [concept, inner sep=5, ball color=blue1!90!black] (Huari) {Huari}
    }
  }
  child [concept color=mypink3!90!black] {
    node [concept,  inner sep=10, ball color=mypink3!90!black] (Chancay) {Chancay}
    child [concept color=blue1!90!black] {
      node [concept, inner sep=5, ball color=blue1!90!black] (Huacho) {Huacho}
    }
  }
  child [concept color=mypink3!90!black] {
    node [concept,  inner sep=10, ball color=mypink3!90!black] (Chancay) {Chancay}
    child [concept color=blue1!90!black, grow=120] {
      node [concept, inner sep=5, ball color=blue1!90!black] (Huacho) {Huacho}
    }
  }
  child [concept color=mypink3!90!black] {
    node [concept,  inner sep=10, ball color=mypink3!90!black] (Chancay) {Chancay}
    [counterclockwise from=180]
    child [concept color=blue1!90!black] {
      node [concept, inner sep=5, ball color=blue1!90!black] (Huacho) {Huacho}
    }
  }
  child [concept color=mypink3!90!black] {
    node [concept,  inner sep=10, ball color=mypink3!90!black] (Chancay) {Chancay}
    child [concept color=blue1!90!black, grow=-120] {
      node [concept, inner sep=5, ball color=blue1!90!black] (Huacho) {Huacho}
    }
  }
  ;
\end{tikzpicture}
\end{document}

various ways of placing nodes

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .