2

I have very little experience with Tikz but I would like to recreate a diagram. The original looks like this:

Beispielbild

I luckily found a good template for this diagram that also allows the labels to be positioned circularly along a line. (Unfortunately, that's the catch, why I didn't get anywhere with other programs.)

This template + picture can be found at:

see first answer to this question

or like this:

\documentclass[tikz,border=10pt,multi]{standalone}
\usetikzlibrary{decorations.text}
\begin{document}
\begin{tikzpicture}
  \draw [thick] (0,0) circle (3cm);
  \foreach \i/\j/\k in {0/something/tadpole,45/anything/cauldron,90/another/bread soup,135/whatever/rock candy,180/whenever/lollipop,225/whoever/Bell of Bow,270/why ever/seesaw,315/nothing/roundabout} {
    \draw [black] (0,0) -- (\i:3cm);
    \path [decorate, decoration={text along path, text=\j, text align=center}] (\i:27.5mm) arc (\i:{\i+45}:27.5mm);
    \path [decorate, decoration={text along path, text=\k, text align=center}] (\i:24mm) arc (\i:{\i+45}:24mm);
  }
\end{tikzpicture}
\end{document}

My questions would be how to redesign this code to allow me to trace the diagram in the example image. The problem is that this code is only made for an even split of circles.(For a smaller diagram, for example, I have already succeeded in dividing this circle into three equal parts and creating a second circle twice the size above it, but these attempts are no longer sufficient here).

If someone could help me to create a code in which you have a maximum of 12 single fields (like in the example picture the outermost ring) or even less fields, which are no longer evenly divided and the text is nevertheless centered in a larger field, that would be more than ingenious.

My knowledge is just not sufficient for this. I was only able to create this smaller diagram from derivation of the code and it was not programmed myself.

It would also be fine for me if I could simply generate each ring individually with the new code. So the straight lines starting from the center of the circle don't even have to be interrupted within the programming... I could do that manually in post-processing.

I would be happy if I could make this diagram digitally editable in some way. Many many thanks for any support! :)

2
  • If you want to be able to draw many different complex pie charts like this one, you'll have to make a complete adaptable template and it's a lot of work. If you just want to draw the one in the picture, it could be done by hand. Do you know exactly what to place inside the chart?
    – SebGlav
    Apr 19, 2021 at 13:42
  • It is only this one diagram. The contents are clearly defined and the structure should also be like the default. The challenge with this diagram, however, is the lettering: the lettering is centered in every single field and the lettering is also curved, so it runs along the line of the circles. I have not been able to find a drawing program that allows the design for text in this way. So basically a code would already be sufficient, with which one can design a single ring in different divisions... these individual rings I could then put into each other in a separate program.
    – Tiv
    Apr 20, 2021 at 4:23

1 Answer 1

4

For legibility I'm going to make a macro that puts all the texts in their paths, but it is essentially the same used by cfr in the link you provided. In addition, we have to draw a couple of circles and lines.

Something like this:

\documentclass[border=2mm]{standalone}
\usepackage    {ifthen}
\usepackage    {tikz}
\usetikzlibrary{decorations.text}

\newcommand\mytext[6] % inner radius, outer radius, start angle, end angle, relative position, text
{%
  \pgfmathsetmacro\myradius{#5*#2+(1-#5)*#1}
  \ifthenelse{#3 > #4}{\def\raiseamount{0}}{\def\raiseamount{-0.18 cm}}
  \path[decorate, decoration={text along path, text=#6, text align=center, raise=\raiseamount}]
    (#3:\myradius) arc (#3:#4:\myradius);
}

\begin{document}
\begin{tikzpicture}[scale=1.5,line join=round,line cap=round]
  % radii
  \def\ra{1}
  \def\rb{2}
  \def\rc{3}
  \def\rd{4.5}
  \def\re{5.5}
  % circles
  \foreach\i in {\ra,\rb,\rc,\rd,\re}
  {%
    \draw[thick] (0,0) circle (\i);
  }
  % lines
  \foreach\a/\i in {  0/\rd/,  30/0,    60/\rb,  90/0,   120/\rd, 150/0,%
                    180/\rb,  210/\rd, 240/\ra, 270/\rd, 300/\rd, 330/\rd}
  {%
    \draw[thick] (\a:\i) -- (\a:\re);
  }
  % labels
  \mytext{0}  {\ra}{90}  {30}{0.8}{aaa aa}
  \mytext{0}  {\ra}{150} {90}{0.8}{bbb bb}
  \mytext{0}  {\ra}{150}{390}{0.8}{Hole in the sky} 
  %
  \mytext{\ra}{\rb} {90} {30}{0.5}{dd dd dd}
  \mytext{\ra}{\rb}{150} {90}{0.5}{eee eee}
  \mytext{\ra}{\rb}{150}{240}{0.5}{ff ff ff}
  \mytext{\ra}{\rb}{240}{390}{0.5}{Gateway to heaven}
  %
  \mytext{\rb}{\rc} {60} {30}{0.5}{hh}
  \mytext{\rb}{\rc} {90} {60}{0.5}{ii}
  \mytext{\rb}{\rc}{150} {90}{0.5}{jjjj}
  \mytext{\rb}{\rc}{180}{150}{0.5}{kk kk}
  \mytext{\rb}{\rc}{180}{240}{0.5}{and so on...}
  \mytext{\rb}{\rc}{240}{390}{0.5}{I don't know any more words to put here}
  % example with two lines
  \mytext{\rc}{\rd} {90} {60}{0.7}{Window in time}
  \mytext{\rc}{\rd} {90} {60}{0.3}{Through it I'll fly}
  % and so on
\end{tikzpicture}
\end{document}

enter image description here

EDIT: I added an additional parameter to the macro \mytext to modify the relative position. This (and the scale) allows to put more text in each sector, or to put more than one line. I also adjusted (approximately) the vertical align so the clockwise and anticlockwise texts are at the same height.

14
  • Hello Juan, first of all my utmost thanks! I am really impressed and happy. I did not expect that someone makes so much effort and even already sets the lines correctly, etc. How can this graphic be enlarged entirely? (In the very center of the diagram, where you put the "b", there should be room for 6 letters at least). Is it possible to create the text in such a way that when it gets to the bottom area, it slowly turns upside down? So that the individual letters always remain aligned to the center of the circle? Once again, thank you very much!
    – Tiv
    Apr 23, 2021 at 10:36
  • @Tiv, you only need to change the radii \ra,\rb,... as you need. Perhaps, also changing the font size could help. If I correctly understand your last question, it would need a different approach, playing with each letter individually. Apr 23, 2021 at 10:49
  • under which setting do I change the font size? I'm sorry, I'm an absolute beginner and there is a huge amount of information on the internet about this whole topic. by aligning the font, I didn't mean every single letter. I meant it as follows: currently, the font in the lower area is straight, so you can read it without turning your head. In the original diagram, however, the font in the lower area is upside down. Since it is a successive sequence, this is actually better in this case. if you read along a row, you must then turn your head and read the font upside down.
    – Tiv
    Apr 23, 2021 at 11:03
  • and what do i have to do to write multiline in a segment? hope it's ok if i ask some more questions.... unfortunately I still have to learn a lot.
    – Tiv
    Apr 23, 2021 at 11:09
  • 1
    @Hany, try this: \documentclass[tikz,border=2mm]{standalone} \usepackage{ifthen} \usetikzlibrary{decorations.text} \newcommand\mytext[7] {\pgfmathsetmacro\myradius{#5*#2+(1-#5)*#1} \fill[#7] (#3:#2) arc (#3:#4:#2) -- (#4:#1) arc (#4:#3:#1) -- cycle; \ifthenelse{#3 > #4}{\def\raiseamount{0}}{\def\raiseamount{-0.18 cm}} \path[decorate, decoration={text along path,text=#6,text align=center,raise=\raiseamount}] (#3:\myradius) arc (#3:#4:\myradius);} \begin{document} \begin{tikzpicture}[scale=1.5] \mytext{2}{3}{90}{60}{0.5}{ii}{green} \end{tikzpicture} \end{document} Feb 5, 2022 at 17:18

You must log in to answer this question.

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