# Problems with relative "axis cs:" coordinates in pgfplots

Please behold this MWE (compat is at 1.13, so by default the coordinates are in axis cs:):

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usepackage{pgfplots}\pgfplotsset{compat=1.13}
\begin{document}

\begin{tikzpicture}[
]
\begin{axis}[
xmin=0, xmax=1500,
ymin=60, ymax=100,
axis y line* = right,
axis x line = none,
clip mode = individual,
]
\draw [green, <-] (600, 93) -- ++(0,-1.5);
\draw [red,  <-] (600, 93) -- (600, 93-1.5);
\end{axis}
\end{tikzpicture}
\end{document}


The two draw commands executes perfectly and they give the same arrow, so you really see just one:

If you now comment out the \addplot and use the previous one, i.e, like this:

    \addplot [domain=0:1500] {97-x/150};


the relative coordinates \draw goes astray:

Where is my fault? Is that relative movements are not supposed to work in axis cs:? Why it depends on the previous plot?

• You have to use the axis direction cs for relatve positions: \draw [green, <-] (600, 93) -- ++(axis direction cs:0,-1.5);.
– esdd
Oct 4 '16 at 13:08
• By the way, I found it --- it's in chapter 4.17.1 of the documentation. Oct 4 '16 at 16:40

axis cs allows only absolute position. If you need relative positions you have to use the axis direction cs:

\draw [green, <-] (600, 93) -- ++(axis direction cs:0,-1.5);


For more information see section "4.17.1 Accessing Axis Coordinates in Graphical Elements" in the documentation of pgfplots.

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usepackage{pgfplots}\pgfplotsset{compat=1.13}
\begin{document}

\begin{tikzpicture}[
]
\begin{axis}[
xmin=0, xmax=1500,
ymin=60, ymax=100,
axis y line* = right,
axis x line = none,
clip mode = individual,
]