4

How to edit the following code

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,arrows.meta,positioning,backgrounds}
\usepackage{pgfplots}
\begin{document}
\begin{frame}[t]
\frametitle{}
\begin{tikzpicture}[scale=.9, transform shape]
\begin{scope}[scale=.4]
\draw[red, ultra thick, fill=red!50!white] (0,0)node (o){} circle (2.5cm);
\draw[red, ultra thick, fill=none] (o.center) circle (2cm);
\draw[red, ultra thick] ([shift={(-60.:2cm)}]o.center) -- ([shift={(140.:2cm)}]o.center) ([shift={(-40.:2cm)}]o.center) -- ([shift={(120.:2cm)}]o.center);
\begin{scope}[on background layer]
\draw [blue, -latex, line width=.2cm] ([shift={(90.:3cm)}]o.center) -- +(-90:6.4cm);
\end{scope}
\end{scope}
\end{tikzpicture}
\end{frame}
\end{document}

enter image description here

to make it looks like the following figure.

enter image description here

5

Something like this?

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\begin{document}
\begin{frame}[t]
\frametitle{}
\begin{tikzpicture}[scale=.9]
\begin{scope}[scale=.4]
\draw [blue, -latex, line width=.2cm] (90.:3cm) -- +(-90:6.4cm);
\draw[red, line width=4mm] (0,0) circle (2.25cm)
(135:2.25cm) -- (-45:2.25cm);
\end{scope}
\end{tikzpicture}
\end{frame}
\end{document}

enter image description here

  • 1
    @marmotThank you very much. Just one comment, what is coordinate(o) for? – Hany Feb 20 at 9:00
  • @Hany The coordinate coordinate(o) is unnecessary. I removed it. – marmot Feb 20 at 14:48
5

If I understand correctly, you don't really need such a complicated code:

\documentclass[tikz,margin=3mm]{standalone}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\draw[line width=2mm,blue,-latex] (0,1)--(0,-2);
\draw[line width=3mm,red] (0,0) circle (1);
\draw[line width=3mm,red] ($(0,0)+(135:1)$)--($(0,0)+(-45:1)$);
\end{tikzpicture}
\end{document}

enter image description here

  • last line can be \draw[line width=3mm,red] (135:1) -- +(-45:2); – Zarko Feb 20 at 9:21

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.