\pdfcompresslevel=0
\documentclass[a4paper]{article}

\usepackage{pgfplots}
\usepgfplotslibrary{patchplots}

\begin{document}

\begin{tikzpicture}
%\tracingcommands=2\tracingmacros=2
	\begin{axis}
	\addplot[red,samples=6,
		unbounded coords=jump,x filter/.code={\ifnum\coordindex=3 \def\pgfmathresult{inf}\fi}]
	{x^3};	
	\end{axis}
\end{tikzpicture}

\begin{tikzpicture}
%\tracingcommands=2\tracingmacros=2
	\begin{axis}
	\addplot[mesh,red,patch type=cubic spline,patch type sampling,samples=6,point meta=none,
		unbounded coords=jump,x filter/.code={\ifnum\coordindex=12 \ifnum\coordindex<16 \def\pgfmathresult{inf}\fi\fi}]
	{x^3};	
	\end{axis}
\end{tikzpicture}


\begin{tikzpicture}
%\tracingcommands=2\tracingmacros=2
	\begin{axis}
	\addplot[red,samples=6,
		unbounded coords=jump,x filter/.code={\ifnum\coordindex=3 \def\pgfmathresult{inf}\fi}]
	{x^3} \closedcycle;	
	\end{axis}
\end{tikzpicture}

\begin{tikzpicture}
%\tracingcommands=2\tracingmacros=2
	\begin{axis}
	\addplot[mesh,red,patch type=cubic spline,patch type sampling,samples=6,point meta=none,
		unbounded coords=jump,x filter/.code={\ifnum\coordindex=12 \ifnum\coordindex<16 \def\pgfmathresult{inf}\fi\fi}]
	{x^3} \closedcycle;	
	\end{axis}
\end{tikzpicture}
\end{document}

