# Drawing lines in polar coordinates (polaraxis)

I am trying to draw a picture of a line but using a polar coordinate system:

\begin{center}
\begin{tikzpicture}
\begin{polaraxis}[
xticklabels={,0,$\frac\pi6$,$\frac\pi3$,$\frac\pi2$,$\frac{2\pi}3$,$\frac{5\pi}6$,
$\pi$,$\frac{7\pi}6$,$\frac{4\pi}3$,$\frac{3\pi}2$,$\frac{5\pi}3$,$\frac{11\pi}6$}
]
\draw (\rtheta{0}{0}) -- (\rtheta{1}{30}) -- (\rtheta{1}{120});
\end{polaraxis}
\end{tikzpicture}
\end{center}


I can get most curves except ones such as plotting theta = 1 (a line).

I tried looking and found:

drawing lines using polar axis coordinate system in pgfplots

But I couldn't get this to work. This is what I keep getting:

• \addplot[no marks] coordinates {(1,0) (1,1)};? – user229669 Dec 2 '20 at 4:38

## 1 Answer

According to TikZling hint:

You mean twolines like this?

\documentclass{article}

\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{pgfplots.polar}

\begin{document}

\begin{center}
\begin{tikzpicture}
\begin{polaraxis}[
xticklabels={,0,$\frac\pi6$,$\frac\pi3$,$\frac\pi2$,$\frac{2\pi}3$,$\frac{5\pi}6$,
$\pi$,$\frac{7\pi}6$,$\frac{4\pi}3$,$\frac{3\pi}2$,$\frac{5\pi}3$,$\frac{11\pi}6$}
]
\addplot[no marks] coordinates {(0,0) (30,0.8) (120,1)};
\end{polaraxis}
\end{tikzpicture}
\end{center}

\end{document}


• Yep! Simple enough... No idea why that didn't occur to me. Thanks. – Ecoi Dec 2 '20 at 5:02