I would like to plot the family of curves with equation xy=c for several values of c. I also want each curve to be labeled with the value of c it corresponds to.
Here is my MWE:
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=-3.0,xmax=3.0,
ymin=-3.0,ymax=3.0,
axis x line=middle,
axis y line=middle,
axis equal image,
cycle list={blue}
]
\pgfplotsinvokeforeach{-3.0,-2.5,...,-0.5,0.5,1.0,...,3.0}{
\addplot+[domain=-3:-0.1,forget plot] {#1/x};
\addplot+[domain=0.1:3] {#1/x} node[pos=0.5] {$#1$};
}
\end{axis}
\end{tikzpicture}
\end{document}
I get each curve plotted, but only two of them are labeled:
How do I get all twelve curves labeled?
pos=0.5
is not always in the visible range.