4

My question is related to following answer in order to draw very basic(draft) people. I am having trouble to align and scale basic people on top of a time-line. Following code piece draws little bit large peope figures.


\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
    \draw[fill=black] (0,0) circle [radius=18pt] node[yshift=10mm] {Alice};
    \draw[thick,fill=black] (1,-1.8) arc(0:180:1cm and 1 cm);
\end{tikzpicture}
 \end{document} ```


Example:

\documentclass[tikz, margin=3mm]{standalone}
\usepackage{siunitx}

\usepackage{tikzpeople} \usetikzlibrary{positioning,calc, arrows.meta} \usetikzlibrary{decorations.pathreplacing}

\begin{document}

\begin{tikzpicture} \draw[->, -Latex, line width=1pt] (0,0)node(a){} -- (11,0) node (b)[below] {} ; \foreach \x [count=\i] in {0,50,...,500} { \def \inBetSpace {1} \draw[line width=1pt] (\i*\inBetSpace-\inBetSpace,-2mm) nodebelow {\x} -- ++(0,4mm); } \node[bob,minimum size=0.8cm, label=\scriptsize Bob] (ail) at (2,2.4) {}; \draw[->, -Latex, line width=1pt] (ail) -- +(0,-2.4+0.2)nodefill=white, anchor=center, double=black, midway,inner sep=1pt{\tiny Submits};

\node[bob,minimum size=0.8cm, label=\scriptsize Alice] (ail) at (5,2.4) {};

\draw[->, -Latex, line width=1pt] (ail) -- +(0,-2.4+0.2)nodefill=white, anchor=center, double=black, midway,inner sep=1pt{\tiny Submits};

\end{tikzpicture} \end{document}

Output:

enter image description here


I just want to replace Alice and Bob with the basic people figure.

  • I was not able to make it align and scale.
  • I was not able to link arrows linked to the drawn people figure.

Is there any easy way to draw following sketch?

enter image description here

alper
  • 1,389

1 Answers1

3

A suggestion:

\documentclass[tikz, margin=3mm]{standalone}
\usepackage{siunitx}

\usepackage{tikzpeople} \usetikzlibrary{positioning,calc, arrows.meta} \usetikzlibrary{decorations.pathreplacing}

\begin{document}

\begin{tikzpicture} \draw[->, -Latex, line width=1pt] (0,0)node(a){} -- (11,0) node (b)[below] {} ; \foreach \x [count=\i] in {0,50,...,500} { \def \inBetSpace {1} \draw[line width=1pt] (\i*\inBetSpace-\inBetSpace,-2mm) nodebelow {\x} -- ++(0,4mm); }

% Bob

\draw[thick,fill=black] (2.4,2.2) arc(0:180:0.4cm and 0.4 cm) nodebelow,midway{Bob}; \node[above=of ail,circle,fill=black,yshift=-0.9cm,minimum size=0.5cm,label=above:{\scriptsize Bob}]{};

\draw[->, -Latex, line width=1pt] (ail) -- +(0,-2.2+0.2)nodefill=white, anchor=center, double=black, midway,inner sep=1pt{\tiny Submits};

% Alice

\draw[thick,fill=black] (5.4,2.2) arc(0:180:0.4cm and 0.4 cm) nodebelow,midway{alice}; \node[above=of ail,circle,fill=black,yshift=-0.9cm,minimum size=0.5cm,label=above:{\scriptsize Alice}]{};

\draw[->, -Latex, line width=1pt] (ail) -- +(0,-2.2+0.2)nodefill=white, anchor=center, double=black, midway,inner sep=1pt{\tiny Submits};

\end{tikzpicture} \end{document}

EDIT: added \scriptsize to change font size for Bob and Alice.

enter image description here

Roland
  • 6,655
  • Not sure how does it work but thanks this is exactly what I was looking for. In onder to change font size for Bob and Alice should I use \scriptsize before them? – alper Apr 05 '21 at 12:38
  • 1
    To adjust font size in a node you can do it like normal in LaTex with \tiny, \scriptsize, \footnotesize, \small, \normalsize, \large, \LARGE, \huge and \Huge. – Roland Apr 05 '21 at 12:47