-1

I would like to draw a circular diagram with objects on its circumference similar to this MWE provided by Zarko(I get errors on my computer when running this code but it worked fine for Zarko):

    \documentclass[border=3.141592mm]{standalone}

\usepackage{tikz}
\usetikzlibrary{arrows.meta,
                positioning}

    \begin{document}
        \begin{tikzpicture}[
    node distance = 22mm and 11mm,
         C/.style = {circle, draw, minimum size=#1},
       C/.default = 24mm
    every label/.append style = {inner sep=1pt}
                            ]
    \node (a) [C]   {};
        \foreach \i in {30, 150, 270}
            \draw (a.center)  ++ (\i:9mm) -- ++ (\i:6mm); 
        \node[font=\Large, label= above:A, label=below:1]   at (a.90) {$\times$};
        \node[C=2mm, label=210:B, label=30:2]   at (a.210) {};
        \node[C=2mm, label=330:C,label=150:3]   at (a.330) {};
    \node (b) [C, below  left=of a]  {};
    \node (c) [C, below right=of a]  {};
    %
    \draw[very thick, -Straight Barb]   ([yshift=-4mm] a.south) -- ++ (0,-7mm);
        \end{tikzpicture}
    \end{document}

I need a circle cut equally in 3 parts labelled A,B and C with objects(circular and 'x') in the cut circumference.

EDIT: Firstly, thanks for the answer gernot. Now, I to add this information on the page:

\begin{align*}
\textbf{Time 0}\\
(i)  \quad  1&=i \text{ in } A\\
(ii) \quad  2&=s \text{ in } B\\
(iii)\quad  3&=s \text{ in } C\\ 
\end{align*}

\text{Let  } $[(i,A), (s,B), (s,C)]= X$.

so this is how I want the page to split: |x|x|image| in other words, I want to split the page in 3(without the lines) and have info where it marked "x". I don't know how to align all 3 items.

enter image description here

6
  • In my answer on your previous question is missed comma after C/.default=24mm :-(. Sorry for that. So it should be C/.default = 24mm,. Now corrected in my answer. that you can correct you code.
    – Zarko
    Feb 3 at 13:22
  • Thank you Zarko! though I still suck at this so I don't know how to finish it off :(
    – Math
    Feb 3 at 14:03
  • You have all element how to finish your image. can't do this instead you, since it is not clear, what you like to have. I think that the first circle is complete (as far as I can figured out from your sketch, which is frankly said very low quality) . If it is complete just use its code at other circles (in \foreach loops use names of those circles).
    – Zarko
    Feb 3 at 14:13
  • I will try, if I am unsuccessful, I will comment to comment to let you know.
    – Math
    Feb 3 at 14:18
  • @Math Why don't you make a tabular with three columns (in my example I have one with two). Why do you use align*? Your edit still doesn't make clearer how the overall picture should look like. I suggest that you start from my solution, add by hand what you need, and then add a picture to your question.
    – gernot
    Feb 3 at 15:45
5

The code below defines a command

 \board[optional scale factor]{list of triples angle/number/mark}

that draws the circular diagram. The optional argument is the scale factor and defaults to 1.0. The mandatory argument is a comma separated list of triples like 90/1/\cross (node at 12 o'clock numbered 1 and marked with a cross) or 210/2/ (node at 8 o'clock numbered 2 without mark).

enter image description here

\documentclass{article}
\usepackage{tikz}
% \board[optional scale factor, default 1.0]{list of triples angle/number/mark}
\newcommand\board[2][1.0]{%
  \begin{tikzpicture}[baseline={(0,0)},scale=#1]
    \draw (0,0) circle (1);
    % radial lines at angles 30°, 150° and 270°
    \foreach \a in {30, 150, 270}
      \draw (\a:0.9) -- (\a:1.1);
    % label A/B/C outside of circle at angles 90°, 210° and 330°
    \foreach \a/\l in {90/A,210/B,330/C}
      \node at (\a:1.4) {\scriptsize$\l$};
    % draw game positions
    % \a ... angle, \n ... number 1/2/3, \m ... mark  
    \foreach \a/\n/\m in {#2} {
      % node
      \node[circle,draw,minimum size=1em,inner sep = 0,fill=white] at (\a:1) {\m};
      % number inside of circle
      \node at (\a:0.6) {\scriptsize$\n$};
  }
  \end{tikzpicture}%
}
\newcommand\cross{$\times$}
\begin{document}
\begin{center}
  \board[0.8]{90/1/\cross,210/2/,330/3/}\\
  \begin{tabular}[t]{@{}c@{}}
    \board[0.8]{90/2/,190/1/\cross,230/3/}\\
    move
  \end{tabular}
  \begin{tabular}[t]{@{}c@{}}
    \board[0.8]{90/2/,190/1/,230/3/\cross}\\
    status
  \end{tabular}
\end{center}
\end{document}

To arrange the text and the diagrams as shown in the picture, you can use all the possibilities offered by LaTeX. The \board{...} commands behave like (big) letters aligned in the center. For additional graphical elements, you can use the approach described in my answer to "How to add arrow in equations and matrix?".

enter image description here

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows} % needed for arrow tip stealth'
\newcommand\tikznode[3][]{%
  \tikz[remember picture,baseline=(#2.base)]
    \node[minimum size=0pt,inner sep=0pt,#1](#2){#3};%
}
% \board[optional scale factor, default 1.0]{list of triples angle/number/mark}
\newcommand\board[2][1.0]{%
  \begin{tikzpicture}[baseline={(0,0)},scale=#1]
    \draw (0,0) circle (1);
    % radial lines at angles 30°, 150° and 270°
    \foreach \a in {30, 150, 270}
      \draw (\a:0.9) -- (\a:1.1);
    % label A/B/C outside of circle at angles 90°, 210° and 330°
    \foreach \a/\l in {90/A,210/B,330/C}
      \node at (\a:1.4) {\scriptsize$\l$};
    % draw game positions
    % \a ... angle, \n ... number 1/2/3, \m ... mark  
    \foreach \a/\n/\m in {#2} {
      % node
      \node[circle,draw,minimum size=1em,inner sep = 0,fill=white] at (\a:1) {\m};
      % number inside of circle
      \node at (\a:0.6) {\scriptsize$\n$};
  }
  \end{tikzpicture}%
}
\newcommand\cross{$\times$}
\begin{document}

\paragraph{Time 0}\mbox{}\\
\begin{tabular}{@{}p{5em}@{}}
  $1=i$ in $A$\\
  $2=s$ in $B$\\
  $3=s$ in $C$
\end{tabular}
$\longrightarrow$
\tikznode{X}{$[(i,A),(s,B),(s,C)]=X$}
\board[0.9]{90/1/\cross,210/2/,330/3/}

\paragraph{Time 1}\mbox{}\\
\begin{tabular}{@{}p{5em}@{}}
  $1=r$ in $B$\\
  $2=s$ in $A$\\
  $3=i$ in $B$
\end{tabular}
$\longrightarrow$
\tikznode{Y}{$[(r,B),(s,A),(i,B)]=Y$}
\begin{tabular}[t]{@{}c@{}}
  \board[0.9]{90/2/,190/1/\cross,230/3/}\\
  move
\end{tabular}
\begin{tabular}[t]{@{}c@{}}
  \board[0.9]{90/2/,190/1/,230/3/\cross}\\
  status
\end{tabular}

\begin{tikzpicture}[remember picture,overlay,>=stealth',shorten <=2pt,shorten >=2pt]
  \draw[->] (X) edge[bend left] node[right]{$P_{xy}=p/8$} (Y);
\end{tikzpicture}
\end{document}
10
  • This is perfect! Is it possible to "squeeze the drawing because I will need to explain what's going on?
    – Math
    Feb 3 at 15:04
  • @Math What do you want to squeeze? Make the circle smaller or arrange the circles closer to each other in the tabular? It is unclear where you want to put the whole picture and where you want to place the explanation
    – gernot
    Feb 3 at 15:06
  • I want to squeeze the whole image. I wish to explain what's going on to the left of the picture in two columns(one column time related and other move/status). something like this: | x | x | image |
    – Math
    Feb 3 at 15:08
  • actually the image is nice, its quite small so now my issue is, how do I put it to the right hand side of the page?
    – Math
    Feb 3 at 15:12
  • @Math The diagram is just a box like any letter, \minipage, \tabular, whatever. If you know how to arrange the page if you had text instead of the diagram, then you are done. It is really not clear what you want to achieve.
    – gernot
    Feb 3 at 15:24

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.