1

A short question: How draw something like this?

enter image description here

9

enter image description here

\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw [very thick] (-4,0) -- (4,0);
\draw [very thick] (0,-4) -- (0,4);
\foreach [
  evaluate=\rad as \qb using int(\rad+4),
  evaluate=\rad as \qc using int(\rad+8),
  evaluate=\rad as \qd using int(\rad+12)
  ]
  \rad in {1,2,3,4} {
     \draw (0,0) circle[radius=\rad];
     \node at (45:\rad-0.5) {\rad};
     \node at (-45:\rad-0.5) {\qb};
     \node at (135:\rad-0.5) {\qd};
     \node at (-135:\rad-0.5) {\qc};
   }
\end{tikzpicture}
\end{document}

Shorter version, same output

\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw [very thick] (-4,0) -- (4,0)
                   (0,-4) -- (0,4);
\foreach \rad in {1,2,3,4} {
     \draw (0,0) circle[radius=\rad];
     \foreach [count=\i from 0,evaluate=\i as \y using int(\rad+\i*4)] \q in {45,315,225,135}
        \node at (\q:\rad-0.5) {\y};
   }
\end{tikzpicture}
\end{document}
  • Thanks for this straight forward answer, another question: is it possible to make two of this as two sub figure(i.e two of this set of circles in a row with captions)? – dariush Dec 2 '16 at 18:18
  • @dariush Try avoiding asking new questions in comments like that. But yes, of course it's possible, just make two subfigures as you would do normally (e.g. with the subcaption package and the subfigure environment, see tex.stackexchange.com/questions/37581/… for example), and place one tikzpicture in each subfigure. – Torbjørn T. Dec 2 '16 at 18:22
2

PSTricks was designed to solve your problem.

\documentclass[pstricks,preview,margin=5mm]{standalone}

\begin{document}
\begin{pspicture}(-4,-4)(4,4)
    \psline(-4,0)(4,0)\psline(0,-4)(0,4)
    \foreach \i in {0,1,2,3}{%
        \pscircle{!\i\space 1 add}
        \foreach \j in {0,1,2,3}{\rput(!\i\space .5 add \j\space -90 mul 45 add PtoC){\the\numexpr4*\j+\i+1\relax}}
    }
\end{pspicture}
\end{document}

enter image description here

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.