3

How to make circle of text in latex? Seee the picture below. How to make it in generally?

Thanks for some ideas.

enter image description here

  • 2
    Welcome to TeX.SX! This seems like a do-it-for-me question. Please post what you've got so far (TikZ code, pstricks code, ...) as a MWE. – TeXnician May 21 '17 at 7:08
  • 1
    I would like to point out that the underlying structure of such a circle is actually a tree. – marsupilam May 21 '17 at 7:40
6

Steps:

  1. background color: draw the coloured wheel in the background
  2. construct wheel: draw lines and circles above
  3. add text: input text positioning

enter image description here

Coloring: Draw the path of the different parts. With \usepackage{xcolor} you could use own colors liek \definecolor{darkbrown}{RGB}{108,86,0}, \definecolor{darkred}{RGB}{183,0,19}. Also you could use the option opacity.

Inner: radius 0 to 3, single parts/ color => \path

\path[fill,darkbrown,opacity=0.7] (10:0) -- (10:3) -- ([shift=(10:3cm)]0,0)arc (10:50:3cm) -- (50:3) -- (50:0); ...

Middle: radius 3 to 6, multiple parts/ color => \foreach loop

\foreach[evaluate=\xi using int(\ang+10)] \ang in {10,20,...,40}{
\path[fill,brown,opacity=0.5] (\ang:3) -- (\ang:6) -- ([shift=(\ang:6cm)]0,0)arc (\ang:\xi:6cm) -- (\xi:6) -- (\xi:3);
}

Every part has an angle of 10 -> evaluate=\xi using int(\ang+10). So \xi is defined with \ang+10 and represents the end of one single element.

Outer: radius 6 to 9, multiple parts/ color => also \foreach loop is used like above.

Construct the wheel: With predifend angles of 10,50,130,190,230,310(inner,#6 elements), 0,10,...,350(middle,#36 elements) and 5,10,...,360(outer,#72 elements) you can create your wheel.

% inner
\foreach \ang in {10,50,130,190,230,310}{
    \draw [black,thick] (\ang:0) -- (\ang:3);
}
\draw[thick] (0,0) circle (3cm);

% middle
\foreach \ang in {0,10,...,350} {
    \draw [black,thick] (\ang:3) -- (\ang:6);
}
\draw[thick] (0,0) circle (6cm);

% outer
\foreach \ang in {5,10,...,360} {
    \draw [black,thick] (\ang:6) -- (\ang:9);
}
\draw[thick] (0,0) circle (9cm); 

text: With(\usepackage{pgfmath} you could define a data array, per single ring, like this one here:

\def\namesInner{{"string A","string B","string C"}

Then you could add the text like this:

    \draw [style01] (\ang:1.5) node[rotate=\ang]
      {\pgfmathparse{\names[\xi]}\pgfmathresult};

This could happen inside a loop, the rotations depends on the textposition -> if conditions (like \ifnum\ang<271) are helpful.

MWE:

\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\tikzset{style01/.style={ font=\bfseries\normalsize\sffamily}}

\def\names{{"DISGUST","ANGER","FEAR","SURPRISE","HAPPY","SAD"}}

\def\namesTwo{{"GUILTY","AVOIANCE","AWFUL","DISAPPOINTED","DISAPPROVAL","CRITICAL","DISTANT","FRUSTRATED",
"AGGRESIVE","MAD","HATEFUL","THREATENED","HURT","HUMILIATED","REJECTED","SUBMISSIVE",
"INSECURE","ANXIOUS","SCARED","STARTLED","CONFUSED","AMAZED","EXCITED","JOYFUL",
"INTERESTED","PROUD","ACCEPTED","POWERFUL","PEACEFUL","INTIMATE","OPTIMISTIC","BORED",
"LONELY","DEPRESSED","DESPAIR","ABANDONED"}}

\def\namesThree{{"ASHAMED","REMORESFUL","HESITANT","AVERSION","DETESTABLE","REVULSION","REVOLTED","REPUGNANT",
"LOATHING","JUDGMENTAL","SARCASTIC","SKEPTICAL","SUSPICIOUS","WITHDRAWN","IRRITATED","INFURIATED",
"HOSTILE","PROVOKED","ENRAGED","FURIOUS","VIOLATED","RESENTFUL","JEALOUS","INSECURE",
"DEVASTATED","EMBARRASSED","RIDICULED","DISRESPECTED","ALIENATED","INADEQUATE","INSIGNIFICANT","WORTHLESS",
"INFERIOR","INADEQUATE","WORRIED","OVERWHELMED","FERIGHTENED","TERRIFIED","SHOCKED","DISMAYED","DISILLUSONED",
"PERPLEXED","ASTONISHED","AWE","EAGER","ENERGETIC","LIBERATED","ESTATIC","AMUSED","INQUISITIVE",
"IMPORTANT","CONFIDENT","RESPECTED","FULLFILLED","COURAGEOUS","PROVOCATIVE","LOVING","HOPEFUL","SENSITIVE",
"PLAYFUL","OPEN","INSPIRED","INDIFFERENT","APATHETIC","ISOLATED","ABANDONED","EMPTY","INFERIOR",
"VULNERABLE","POWERLESS","VICTIMIZED","IGNORED"}}

\usepackage{xcolor}

\definecolor{darkbrown}{RGB}{108,86,0}
\definecolor{darkred}{RGB}{183,0,19}
\definecolor{darkgreen}{RGB}{0,154,0}
\definecolor{darkorange}{RGB}{224,85,0}
\definecolor{darkyellow}{RGB}{255,255,0}
\definecolor{darkblue}{RGB}{0,29,207}
%\usepackage{pgfmath,pgffor}
\begin{document}

\begin{tikzpicture}[scale=1.0]
%%%%%%%%%%%%%%%%%%%%%
% Coloring:  Background
%%%%%%%%%%%%%%%%%%%%%
%\foreach[evaluate=\xi using int(\ang+10)] \ang in {230,240,...,300}{ % OR
%\foreach \ang [count=\i from 24, evaluate=\i as \xi using int(\i*10)] in {230,240,...,300}{

% inner
\path[fill,darkbrown,opacity=0.7] (10:0) -- (10:3) -- ([shift=(10:3cm)]0,0)arc (10:50:3cm) -- (50:3) -- (50:0);
\path[fill,darkred,opacity=1] (50:0) -- (50:3) -- ([shift=(50:3cm)]0,0)arc (50:130:3cm) -- (130:3) -- (130:0);
\path[fill,darkgreen,opacity=1] (130:0) -- (130:3) -- ([shift=(130:3cm)]0,0)arc (130:190:3cm) -- (190:3) -- (190:0);
\path[fill,darkorange,opacity=0.7] (190:0) -- (190:3) -- ([shift=(190:3cm)]0,0)arc (190:230:3cm) -- (230:3) -- (230:0);
\path[fill,darkyellow,opacity=0.7] (230:0) -- (230:3) -- ([shift=(230:3cm)]0,0)arc (230:310:3cm) -- (310:3) -- (310:0);
\path[fill,darkblue,opacity=0.7] (310:0) -- (310:3) -- ([shift=(310:3cm)]0,0)arc (310:370:3cm) -- (370:3) -- (370:0);

% middle (Parts:36)
\foreach[evaluate=\xi using int(\ang+10)] \ang in {10,20,...,40}{
\path[fill,brown,opacity=0.5] (\ang:3) -- (\ang:6) -- ([shift=(\ang:6cm)]0,0)arc (\ang:\xi:6cm) -- (\xi:6) -- (\xi:3);
}
\foreach[evaluate=\xi using int(\ang+10)] \ang in {50,60,...,120}{
\path[fill,red,opacity=0.5] (\ang:3) -- (\ang:6) -- ([shift=(\ang:6cm)]0,0)arc (\ang:\xi:6cm) -- (\xi:6) -- (\xi:3);
}
\foreach[evaluate=\xi using int(\ang+10)] \ang in {130,140,...,180}{
\path[fill,green,opacity=0.5] (\ang:3) -- (\ang:6) -- ([shift=(\ang:6cm)]0,0)arc (\ang:\xi:6cm) -- (\xi:6) -- (\xi:3);
}
\foreach[evaluate=\xi using int(\ang+10)] \ang in {190,200,...,220}{
\path[fill,orange,opacity=0.5] (\ang:3) -- (\ang:6) -- ([shift=(\ang:6cm)]0,0)arc (\ang:\xi:6cm) -- (\xi:6) -- (\xi:3);
}
\foreach[evaluate=\xi using int(\ang+10)] \ang in {230,240,...,300}{
\path[fill,yellow,opacity=0.5] (\ang:3) -- (\ang:6) -- ([shift=(\ang:6cm)]0,0)arc (\ang:\xi:6cm) -- (\xi:6) -- (\xi:3);
}
\foreach[evaluate=\xi using int(\ang+10)] \ang in {310,320,...,360}{
\path[fill,blue,opacity=0.5] (\ang:3) -- (\ang:6) -- ([shift=(\ang:6cm)]0,0)arc (\ang:\xi:6cm) -- (\xi:6) -- (\xi:3);
}

% outer
\foreach[evaluate=\xi using int(\ang+5)] \ang in {10,15,...,45}{
\path[fill,brown,opacity=0.3] (\ang:6) -- (\ang:9) -- ([shift=(\ang:9cm)]0,0)arc (\ang:\xi:9cm) -- (\xi:9) -- (\xi:6);
}
\foreach[evaluate=\xi using int(\ang+5)] \ang in {50,55,...,125}{
\path[fill,red,opacity=0.3] (\ang:6) -- (\ang:9) -- ([shift=(\ang:9cm)]0,0)arc (\ang:\xi:9cm) -- (\xi:9) -- (\xi:6);
}
\foreach[evaluate=\xi using int(\ang+5)] \ang in {130,135,...,185}{
\path[fill,green,opacity=0.3] (\ang:6) -- (\ang:9) -- ([shift=(\ang:9cm)]0,0)arc (\ang:\xi:9cm) -- (\xi:9) -- (\xi:6);
}
\foreach[evaluate=\xi using int(\ang+5)] \ang in {190,195,...,225}{
\path[fill,orange,opacity=0.3] (\ang:6) -- (\ang:9) -- ([shift=(\ang:9cm)]0,0)arc (\ang:\xi:9cm) -- (\xi:9) -- (\xi:6);
}
\foreach[evaluate=\xi using int(\ang+5)] \ang in {230,235,...,305}{
\path[fill,yellow,opacity=0.3] (\ang:6) -- (\ang:9) -- ([shift=(\ang:9cm)]0,0)arc (\ang:\xi:9cm) -- (\xi:9) -- (\xi:6);
}
\foreach[evaluate=\xi using int(\ang+5)] \ang in {310,315,...,365}{
\path[fill,blue,opacity=0.3] (\ang:6) -- (\ang:9) -- ([shift=(\ang:9cm)]0,0)arc (\ang:\xi:9cm) -- (\xi:9) -- (\xi:6);
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Draw a lines and circle:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% inner
\foreach \ang in {10,50,130,190,230,310}{
    \draw [black,thick] (\ang:0) -- (\ang:3);
}
\draw[thick] (0,0) circle (3cm);

% middle
\foreach \ang in {0,10,...,350} {
    \draw [black,thick] (\ang:3) -- (\ang:6);
}
\draw[thick] (0,0) circle (6cm);

% outer
\foreach \ang in {5,10,...,360} {
    \draw [black,thick] (\ang:6) -- (\ang:9);
}
\draw[thick] (0,0) circle (9cm); 

%%%%%%%%%%%%%
%% Add text:
%%%%%%%%%%%%%
%% inner
\foreach \ang [count=\i from 1, evaluate=\i as \xi using int(\i-1)] in {30,90,160,210,270,340}{%{-20,30,90,160,210,270}{
\ifnum\ang<91
\draw [style01] (\ang:1.5) node[rotate=\ang]
  {\pgfmathparse{\names[\xi]}\pgfmathresult};
\else
\ifnum\ang<271
\draw [style01] (\ang:1.5) node[rotate=\ang-180]
  {\pgfmathparse{\names[\xi]}\pgfmathresult};
\else
\draw [style01] (\ang:1.5) node[rotate=\ang-360]
  {\pgfmathparse{\names[\xi]}\pgfmathresult};
\fi
\fi
}

%% middle
\foreach \ang [count=\i from 1, evaluate=\i as \xi using int(\i-1)] in {5,15,...,355}{
\ifnum\ang<91
\draw [style01] (\ang:4.5) node[rotate=\ang]
  {\pgfmathparse{\namesTwo[\xi]}\pgfmathresult};
\else
\ifnum\ang<271
\draw [style01] (\ang:4.5) node[rotate=\ang-180]
  {\pgfmathparse{\namesTwo[\xi]}\pgfmathresult};
\else
\draw [style01] (\ang:4.5) node[rotate=\ang-360]
  {\pgfmathparse{\namesTwo[\xi]}\pgfmathresult};
\fi
\fi
}

% outer
\foreach \ang [count=\i from 1, evaluate=\i as \xi using int(\i-1)] in {2,7,...,357}{
\ifnum\ang<90
\draw [style01] (\ang+0.5:7.5) node[rotate=\ang+0.5]
  {\pgfmathparse{\namesThree[\xi]}\pgfmathresult};
\else
\ifnum\ang<270
\draw [style01] (\ang+0.5:7.5) node[rotate=\ang+0.5-180]
  {\pgfmathparse{\namesThree[\xi]}\pgfmathresult};
\else
\draw [style01] (\ang+0.5:7.5) node[rotate=\ang+0.5-360]
  {\pgfmathparse{\namesThree[\xi]}\pgfmathresult};
\fi
\fi
}
\end{tikzpicture}
\end{document}
| improve this answer | |
  • I have to ask: Are the words available for easy copy/paste or did you type them in manually? – Johannes_B Jun 25 '17 at 12:16
  • @Johannes_B I add them manually. Now you could copy and paste the three definitions (\def\names, (\def\namesTwo and \def\namesThree) – Bobyandbob Jun 25 '17 at 12:33
  • Oh wow. Unfortunately i cannot upvote twice. What a job. – Johannes_B Jun 25 '17 at 12:51
4

The transform shape key in tikz is probably the easiest way. Draw the coloured wheel in the background and then add the writing as:

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}[every node/.style={transform shape}]
\draw[rotate=10] (1,0) node{disgust};
\draw[rotate=70] (1,0) node{Anger};
\draw[rotate=130] (1,0) node[rotate=180] {Fear};
\draw[rotate=190] (1,0) node[rotate=180] {Surprise};
\draw[rotate=250] (1,0) node {Happy};
\draw[rotate=310] (1,0) node {Sad};
\end{tikzpicture}
\end{document}

In this framework, you need to rotate with the rotate= key, otherwise the nodes are left untouched. This should give a sufficient starter for finishing your picture.

The inner lining of the wheel

| improve this answer | |

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.