I'm trying to put automatically label several plots. For this purpose, I just discover the pin option to add it to the plots.
This solution works rather well, and semi-automatically. However, when you redefine the axis (by setting xmin, xmax, ymin, and ymax) the position stops working, as the labels appear in the original position not the clipped one.
So, how can I make the pin and pos keywords work within the defined axis instead of the original domain?
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}
\pgfplotsset{
every axis plot post/.append style=
{mark=none}}
\begin{axis}[
xmin=-10, xmax=10,
ymin=-10, ymax=10,
domain=-10:10,
]
\addplot {1.690476*x+0.238095} node [pos=1,pin={above left:{$1$}},inner sep=0pt] {};
\addplot {-57.000000*x+-20.000000} node [pos=1,pin={above left:{$2$}},inner sep=0pt] {};
\addplot {-0.590909*x+-0.113636} node [pos=1,pin={above left:{$3$}},inner sep=0pt] {};
\end{axis}
\end{tikzpicture}
\end{document}
Custom axis

No axis defined


restrict y to domainoption restricts drawing the graph instead of just clipping part of it by restricting the axis. – hugovdberg Apr 11 '14 at 13:39yminandymaxwould. If not then perhaps you should post a question whyrestrict y to domaindoesn't work as expected. – hugovdberg Apr 11 '14 at 14:05