I'm trying to render the following plot so that the shading goes right up to the bounding curve without this jagged aliasing.
The function is $\frac{x}{y^5 + 1}$ in the domain $\sqrt{x} \le y \le 2$ and $0 \le x \le 4$.
I translated this to PGFPlots as
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
unbounded coords=jump,
clip=false,
view={-30}{45},
axis lines=middle,
xmin=0, xmax=4,
ymin=0, ymax=2.15,
zmin=0, zmax=0.5,
xlabel=$x$, ylabel=$y$, zlabel=$z$,
xtick={1, 2, 3, 4}, ytick={1, 2},
ztick={0.5}, zticklabels={$\frac 1 2$}
]
\addplot3[
samples=100, samples y=250,
domain=0:4, domain y=0:2,
colormap/blackwhite, shader=interp, surf, z buffer=sort
] {y >= sqrt(x) ? x / (y^5 + 1) : inf};
\addplot3[
samples=100, domain=0:8
](
{(x < 4) ? x : 8-x},
{(x < 4) ? sqrt(x) : 2},
{(x < 4) ? x / (sqrt(x)^5 + 1) : 0}
);
\addplot3[
samples=100, domain=0:8
](
{(x < 4) ? x : 8-x},
{(x < 4) ? sqrt(x) : 2},
{0}
);
\end{axis}
\end{tikzpicture}
\end{document}
and rendered it with LuaLaTeX.
It takes too long to render when I set samples
and samples y
high enough to make the aliasing disappear. What I want to do is something like samples at
and put a bunch of samples near the edges and fewer in the midst, but samples at
only allows you to set $x$ samples and not $(x,y)$ samples.
Any ideas? Thanks folks!
\documentclass
and ends with\end{document}
. An ad hoc thought to increase the number of samples in the critical region is to do a parametric plot where nowx
andy
are functions that are very flat in this region. – user121799 Nov 13 '18 at 15:31