2

I have a TikZ code with axis environment. I have these inside:

\draw[red,very thick] (6,-3) -- +(0,1);
\draw[very thick] (30:1) -- (2,2);

However, the relative point +(0,1) from (6,-3) doesn't work. Also, the polar coordinate specification r=1,angle=30 also failed. How to solve it?

Full code:

\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
    width=6*1.2 cm, 
    height=5*1.2cm,
    axis lines=middle,
    domain=-2:15,
    xmin=-2, xmax=10,
    ymin=-5, ymax=5,
    axis equal,
    grid=both,grid style={line width=.5pt, draw=gray!10},
    xtick={-2,...,10},
    ytick={-5,...,5},
    xlabel style={font=\tiny},
    xticklabels={\empty},
    yticklabels={\empty}
]
\draw[red,very thick] (6,-3) -- +(0,1);
\draw[very thick] (30:1) -- (2,2);
\end{axis}

\end{tikzpicture}

enter image description here

Eric
  • 1,665
  • 3
    https://tex.stackexchange.com/questions/332553/problems-with-relative-axis-cs-coordinates-in-pgfplots and https://tex.stackexchange.com/questions/129782/drawing-lines-using-polar-axis-coordinate-system-in-pgfplots might be useful. – Torbjørn T. Jun 04 '17 at 12:05

0 Answers0