As per a suggestion, I'm splitting my previous (multiple) question into separate parts.
I want part of the area below a curve to be shaded, but using a filled rectangle results (of course) in the top part of the crunch to be shaded (when it shoudn't be) and the bottom part not to be shaded (when it should).
My code is
\documentclass{article}
\usepackage{tikz,pgfplots}
\usepgfplotslibrary{fillbetween}
\pgfplotsset{compat = newest}
\begin{document}
\begin{figure}
\begin{tikzpicture}
\begin{axis}[
ticks=none,
axis x line=bottom,
axis y line=left,
axis y discontinuity=crunch,
xmin=0,xmax=1.3,
ymin=0.5,ymax=1.3]
\addplot[
domain = 0:sqrt(1/3),
samples =200,
] {sqrt(7/6-x^2)};
\addplot[
domain = sqrt(1/3):sqrt(7/6),
fill = gray,
fill opacity = 0.1,
samples =200,
y filter/.expression={x==sqrt(7/6 )?0:y},
] {sqrt(7/6-x^2)}\closedcycle;
\addplot[
domain = 0:7,
samples =200,
] {sqrt(5/6)};
\fill[gray, opacity = 0.1] (0,0) -- (0,0.9129) -- (0.5774,0.9129) -- (0.5774,0);
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}


\addplot), then usesamples=2– hpekristiansen Apr 23 '22 at 20:18