0

I have the following picture in my Beamer presentation.

enter image description here

How can I draw circiles and arrows with text around specific part of this picture using Tikz?

enter image description here

EDIT: I figured out how to draw a circle. But how to draw a arrow from the specific part of the circle and also connect to text?

\begin{tikzpicture}
     \node(a){\includegraphics[width=0.7\linewidth]{figures/Generators.PNG}};
   \node at(a.center)[draw, red,line width=1pt,ellipse, minimum width=50pt, minimum height=50pt,rotate=-10,yshift=-10pt, xshift=-10pt]{};       
\end{tikzpicture}  
0

2 Answers 2

3

In order to draw circles, you can use the circle path command provided by TikZ. And in order to reach a given point on your circle, start from the circle center and move to the desired point using polar coordinates. A move operation is performed by simply listing two coordinates without a -- in between. And polar coordinate take the form (<angle>:<length>), where the an angle of 0 corresponds to a horizontal line to the right.

All in all, this could look like this:

\documentclass{standalone}

\usepackage{tikz}
\usepackage{graphicx}

\begin{document}
    \begin{tikzpicture}
        \node (a) {\includegraphics[width=3cm]{example-image}};

        \def\circleRadius{0.5}

        % Circle (you can also provide separate x radius and y radius to draw an ellipse
        \draw[blue] (a.center) circle[radius=\circleRadius];

        % Arrow
        \draw[blue, ->] (a.center) ++(-45:\circleRadius) -- ++(-45:0.5) node[anchor=north west, inner sep=0pt] {test};
    \end{tikzpicture}
\end{document}

which produces Resulting image

For ellipses the logic will be a bit more complicated as you will have to calculate the radius of the ellipse in the given direction, but the basic idea should remain the same.

2
\documentclass[tikz, border=1cm]{standalone}
\usetikzlibrary{shapes}
\begin{document}
\begin{tikzpicture}
\node {\includegraphics[width=0.7\linewidth]{example-image-plain}};
\node[draw, red, very thick, ellipse, minimum width=70pt, minimum height=60pt] (e1) at (-1.5,1.2) {};  
\node[draw, green, very thick, ellipse, minimum width=70pt, minimum height=60pt] (e2) at (-1.5,-1.2) {};  
\node[draw, blue, very thick, ellipse, minimum width=70pt, minimum height=120pt] (e3) at (2,0) {};  
\draw[red, very thick, ->] (e1) -- (2,-4) node[right]{Belongs to producer A};     
\draw[green, very thick, ->] (e2) -- (1,-5) node[right]{Belongs to producer B};     
\draw[blue, very thick, ->] (e3) -- (5,-2.5) node[right]{Belongs to producer C};     
\end{tikzpicture}  
\end{document}

Image with ellipses and arrows with text

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .