2
votes
\begin{tikzpicture}
\filldraw[color=black!60, fill=white!5, ultra thick](-1,0) circle (0.8);
\filldraw[color=black!60, fill=white!5, ultra thick](5,0) circle (0.8);
\draw[black, ultra thick] (-1,0) -- (5,0);
\end{tikzpicture}

This code creates a picture with two circles and a line joining their centres. I need to label the left circle as Left Circle and the right one as Right Circle. Both labels have to be at the top of the circles, NOT below them.

Can I please have some help with this?

1

1 Answers

2
votes
\documentclass{standalone}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}

\coordinate (A) at (-1,0);
\coordinate (B) at (5,0);

\filldraw[color=black!60, fill=white!5, ultra thick] (A) circle (0.8);
\filldraw[color=black!60, fill=white!5, ultra thick] (B) circle (0.8);
\draw[black, ultra thick] (A) -- (B);

\node[yshift=1.2cm] at (A) {left circle};
\node[yshift=1.2cm] at (B) {right circle};
\end{tikzpicture}


\end{document}

enter image description here