I am using TikZ and pgfplots for the first time. (I am using it so that I can send class notes to students in a Calculus class that I am teaching.) I have a graph with a slant asymptote. Before I can use pgfplots for the graph, I have some adjustments needed for just the lines in the graph!
I saw in another post that shorten <=2ex, shorten >=2ex
would shorten a line at each end by 2ex. This command shortened the vertical line but not the slanted line. I want arrowheads on both lines; they are on the vertical line but not the slanted line. I want the lines labeled in the same direction as the lines ... but off the line. So, I need to move one label up and one label to the right. Since arctan(3/2) = 56.31 degrees, I used rotate=56.31
in the options for the node. Is there a "slant" command for drawing such labels in the same direction as the line? One more thing. The label "y" for the y-axis is too close to the vertical line x=3/2. How do I adjust its position? (I don't like the position of the "x" for the x-axis, too.)
\documentclass{amsart}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\begin{document}
\begin{tikzpicture}
\begin{axis}[width=4in,axis equal image,
axis lines=middle,
xmin=-15,xmax=15,
xlabel=$x$,ylabel=$y$,
ymin=-10,ymax=10,
restrict y to domain=-12:12,
enlargelimits={abs=1cm},
axis line style={latex-latex},
ticklabel style={font=\tiny,fill=white},
xtick={\empty},ytick={\empty},
]
\draw[dashed,latex-latex,shorten <=2ex, shorten >=2ex] (-13,-17) -- (13,22) node[right,rotate=56.31,pos=0.1]{$\scriptstyle{y=(3/2)x+5/2}$};
\draw[dashed,latex-latex,shorten <=2ex, shorten >=2ex] ({1.5,0} |- {{axis description cs:1,1}}) -- ({{1.5,0}} |- {{axis description cs:1,-1}}) node[right,rotate=90,pos=0.5]{$\scriptstyle{x=3/2}$};
\end{axis}
\end{tikzpicture}
\end{document}