In the following code, two lines are drawn through the origin. One has slope 1 and the other has slope 2. I want to label these lines j and k and put these labels at the arrowhead in the first quadrant. Since the slope of line j is 1/2 and since the right endpoint of its domain is 15, I would like to position the label j with something like
($(15,7.5) + (arctan(1/2):10pt)$).
Likewise, since the slope of line k is 2 and since the right endpoint of its domain is also 15, I would like to position the label k with something like
($(15,30) + (arctan(2):10pt)$).
I got an error message.
The labels for two vertical lines \ell_{1} and \ell_{2} in the drawing are misplaced. Why doesn't the code that I provide put these labels under the lines?
\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\begin{document}
\begin{tikzpicture}
\begin{axis}[width=5in,clip=false,axis equal image,
axis lines=middle,
xmin=-5,xmax=15,
xlabel=$x$,ylabel=$y$,
ymin=-10,ymax=30,
restrict y to domain=-10:30,
enlargelimits={abs=0.5cm},
axis line style={latex-latex},
ticklabel style={font=\tiny,fill=white},
xtick={\empty},ytick={\empty},
xlabel style={at={(ticklabel* cs:1)},anchor=north west},
ylabel style={at={(ticklabel* cs:1)},anchor=south west}
]
\addplot[latex-latex,samples=2,domain=-5:15,blue,name path = A] {0.5*x};
\addplot[latex-latex,samples=2,domain=-5:15,blue,name path = B] {2*x};
\addplot[latex-latex,samples=2,domain=-10:30,blue,name path = C] (5,x);
\addplot[latex-latex,samples=2,domain=-10:30,blue,name path = D] (9,x);
%These commands label the lines.
\node[font=\footnotesize] at ($(15,7.5) + (45:10pt)$) {$j$};
\node[font=\footnotesize] at ($(15,30) + (60:10pt)$) {$k$};
\node[font=\footnotesize] at ($(5,-10) + (0,-10pt)$) {$\ell_{1}$};
\node[font=\footnotesize] at ($(9,-10) + (0,-10pt)$) {$\ell_{2}$};
\end{axis}
\end{tikzpicture}
\end{document}

{and}so thatTikZdoesn not misinterpret the first appearance of a right parenthesis. Thanks. – Adelyn May 25 '15 at 17:49at ($(15,7.5) + ({atan(1/2)}:10pt)$)? The(15,7.5)is a point with respect to the axis coordinate system, but the10ptin({atan(1/2)}:10pt)is a measurement in terms of the unitpoint. – Adelyn May 25 '15 at 17:49(1,1pt)as the coordinates of a point, where willTikZplace it? – Adelyn May 25 '15 at 17:58($(1, 2) + (3, 4) - (0, 0)$)– Heiko Oberdiek May 25 '15 at 18:09(1,1pt). I have not eard of the "canvas coordinate system." Why wouldn't the position of the node($(1,2) + (3, 4)$)be at(4,6)with respect to the axis coordinate system? – Adelyn May 25 '15 at 18:22Help with Help Lines. The grid lines are not drawn with respect to the axis coordinate system. – Adelyn May 25 '15 at 18:22xmin=-5andymin=-10. Then(1,2)transformed toptvalues with origin at the lower left corner (-5, -10) of your axis plot area. Thus(1, 2)are (6u, 12u)from the lower left corner withuas fictive factor between axis units to pt. Then(3, 4)is added, also(8u, 14u). The sum is(14u, 26u)or back to axis coordinates:(9, 16). – Heiko Oberdiek May 25 '15 at 18:30Help with help lines? How would grid lines be drawn so that they align with the axis coordinate system? The command given isdraw[help lines,blue] (-10.5, -10.5) grid (10.5,10.5);– Adelyn May 25 '15 at 18:43