1

Why my angle does not get a line?

I just copied from Label angle with tikz , but something got wrong.

enter image description here

\documentclass{article}
\usepackage{tkz-euclide}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usetkzobj{all}
\usepackage{subcaption}

\usetkzobj{all}
\usetikzlibrary{calc,patterns,angles,quotes}

\begin{document}

\begin{figure}[h]
\centering
\begin{tikzpicture}[scale=1]
 \begin{scope}[thick,font=\scriptsize]
    \draw [->] (-.5,0) -- (5.5,0) node [above left]  {$\operatorname{Re} z$};
    \draw [->] (0,-.5) -- (0,4) node [below right] {$\operatorname{Im} z$};
  \end{scope}
  \coordinate (o) at (0,0);
  \coordinate (z) at (4,3);
  \coordinate (zx) at (4,0);
  \coordinate (zy) at (0,3);
  \draw  (0,0) -- node[above] {$r$} (z) node [right] {$z$};
  \draw [dotted] (z) -- (zx) node [below] {$x$};
  \draw [dotted] (z) -- (zy) node [left] {$y$};
  \draw pic["$\theta$", ->, angle eccentricity=1.2,angle radius = 1cm] {angle = zx--o--z}; 
\end{tikzpicture}
\caption{$z$ in the complex plane.}
\label{fig:complex-plane-1}
\end{figure}
\end{document}
4

Your syntax when using pic was wrong. You obtain

enter image description here

when using

\documentclass{article}
\usepackage{tkz-euclide}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usetkzobj{all}
\usepackage{subcaption}

\usetkzobj{all}
\usetikzlibrary{calc,patterns,angles,quotes}

\begin{document}

\begin{figure}[h]
\centering
\begin{tikzpicture}[scale=1]
 \begin{scope}[thick,font=\scriptsize]
    \draw [->] (-.5,0) -- (5.5,0) node [above left]  {$\operatorname{Re} z$};
    \draw [->] (0,-.5) -- (0,4) node [below right] {$\operatorname{Im} z$};
  \end{scope}
  \coordinate (o) at (0,0);
  \coordinate (z) at (4,3);
  \coordinate (zx) at (4,0);
  \coordinate (zy) at (0,3);
  \draw  (0,0) -- node[above] {$r$} (z) node [right] {$z$};
  \draw [dotted] (z) -- (zx) node [below] {$x$};
  \draw [dotted] (z) -- (zy) node [left] {$y$};
  \pic[draw, "$\theta$", ->, angle eccentricity=0.8,angle radius = 1.5cm] {angle = zx--o--z}; 
\end{tikzpicture}
\caption{$z$ in the complex plane.}
\label{fig:complex-plane-1}
\end{figure}
\end{document}
  • 1
    Small precision: with @PeptideChain's code, just adding a draw option for the pic as in \draw pic[draw, "$\theta$", ... solves the problem too (as well as \path pic[draw, "$\theta$", ..., of course). IOW, the pic path wasn't being drawn, only “accessory stuff” such as node texts. – frougon Aug 3 at 7:42
  • @frougon thank you, this also probably the cause of my error: I merged two correct examples in a wrong one – PeptideChain Aug 3 at 7:54

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.