When i plot the graph of $(x^2+x+1)/(x+1)$, there appears to be a solid vertical line in the plot which happens to be the vertical asymptote, is there a way to make that line dotted and also include the oblique asymptote in a similar fashion?
\documentclass{article}
\usepackage{amsmath}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis lines = center,
xlabel = $x$,
ylabel = {$y$},
xmax = {5},
xmin = {-5},
ymax = {5},
ymin = {-5},
legend pos = outer north east
]
\addplot [
domain=-10:10,
samples=100,
color=black,
]
{(x^2+x+1)/(x+1)};
\addlegendentry{2 turning points}
\end{axis}
\end{tikzpicture}
\end{document}
ymax
andymin
lines and see for yourself. real asymptotes do not touch the curve). The program does not know that this function has a corresponding asymptote. You may have to manually calculate the x value at which the function switches from-infinity
to+infinity
and plot the graph in two separate pieces and then add an asymptote separately. – AJN Feb 7 '16 at 12:35