Pgfplots: Cómo hacer que el gráfico exceda los ejes

Pgfplots: Cómo hacer que el gráfico exceda los ejes

Estoy trazando un pico usando pgfplots. Quiero hacer el eje y hasta (4) únicamente. Sin embargo, quiero que la gráfica del pico continúe más allá del eje y (digamos hasta 10).

¿Existe una manera posible de hacer esto? Este es mi código hasta ahora:

\documentclass{article}
\usepackage{pgfplots}

\pgfkeys{/pgfplots/Axis Style/.style={
width=4.5cm, height=5.8cm,
axis x line=center, 
axis y line=middle, 
samples=300,
ymin=-1, ymax=6,
xmin=-1, xmax=4,
domain=-1:4,
 }}

\begin{document}
\begin{center}
\begin{tikzpicture}
\begin{axis}[font=\scriptsize,every axis legend/.append style={ legend pos=north east,font=\scriptsize},
  Axis Style,
  ytick={-1,1,2,3},yticklabels={$-1$,$1$,$2$,$3$},
  xtick={-1,1,2,3},xticklabels={$-1$,$1$,$2$,$3$},
  xlabel={$x$}, ylabel={$y=\frac{x(x-3.01)}{x-3}$},
  xticklabel shift=9pt,
  legend style={draw=none},
  tick style={color=black},
  x label style={anchor=west},
  y label style={anchor=south west} ]
  \addplot plot[mark=none,  thick, black] (\x,{(\x)/(\x-3)*(\x-3.01)});
\end{axis}
\end{tikzpicture}
\end{center}
\end{document}

Respuesta1

La opción clip=falsehace lo que quieres.

Una mayor mejora y control sobre la trama real puede dar las claves restrict y to domain, unbounded coordsy .samplessamples at

Código

\documentclass[tikz,convert=false]{standalone}
\usepackage{pgfplots}

\pgfplotsset{Axis Style/.style={
  width=4.5cm, height=5.8cm,
  axis x line=center, 
  axis y line=middle, 
  samples=300,
  ymin=-1, ymax=6,
  xmin=-1, xmax=4,
  domain=-1:4,
}}

\begin{document}
\begin{tikzpicture}
\begin{axis}[font=\scriptsize,every axis legend/.append style={ legend pos=north east,font=\scriptsize},
  Axis Style,
  ytick={-1,1,2,3},yticklabels={$-1$,$1$,$2$,$3$},
  xtick={-1,1,2,3},xticklabels={$-1$,$1$,$2$,$3$},
  xlabel={$x$}, ylabel={$y=\frac{x(x-3.01)}{x-3}$},
  xticklabel shift=9pt,
  legend style={draw=none},
  tick style={color=black},
  x label style={anchor=west},
  y label style={anchor=south west},
  clip=false,
  restrict y to domain=-1:17,
  unbounded coords=jump
   ]
  \addplot plot[mark=none, samples=1000, thick, black] (\x,{(\x)/(\x-3)*(\x-3.01)});
\end{axis}
\end{tikzpicture}
\end{document}

Producción

ingrese la descripción de la imagen aquí

información relacionada