2

In relation from these question (the first it is mine) A distribution of clocks in different rulers in a 3D plane and Draw a table of clocks on a plane, what are the best methods to put the clocks of clock package randomizing the hours and the minutes in a grid in the cartesian plane?

enter image description here

Sebastiano
  • 54,118

1 Answers1

3
\documentclass{article}
\usepackage{clock}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\foreach \i in {1,...,10}{
    \foreach \j 
    [evaluate=\j as \h using {int(12*rnd)}, 
    evaluate=\j as \m using {int(60*rnd)}]
    in {1,...,10} 
        \node at (\i,\j) {\clock{\h}{\m}};}
\end{tikzpicture}

\end{document}

enter image description here

Update: Selection clock style

\documentclass{article}
\usepackage{clock}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture} \foreach \i in {1,...,5}{ \foreach \j [evaluate=\j as \h using {int(12rnd)}, evaluate=\j as \m using {int(60rnd)}] in {1,...,5} \node[font={\clockfont\ClockStyle=1\ClockFrametrue\Large}] at (\i,\j) {\clock{\h}{\m}};} \end{tikzpicture}

\end{document}

enter image description here

Ignasi
  • 136,588
  • Thank you very very much. But do I must change in your code to have the circle borders for the clocks? Always thank you. – Sebastiano May 14 '21 at 11:41
  • 1
    @Sebastiano You can do it through font option in node options or including them into node contents. See the updated answer. – Ignasi May 14 '21 at 14:29
  • I have seen now. I not know the technique :-( I'm sorry. However.............MILLE GRAZIE. – Sebastiano May 14 '21 at 15:44