# Adding a shaded region between two curves on a PGFPLOTS graph

Ok,

Say we have a graph defined as

\begin{center}
\begin{tikzpicture}
\begin{axis}[
axis x line=middle,
axis y line=middle
]
\end{axis}
\end{tikzpicture}
\end{center}


This outputs the following:

Which is exactly what the 2 curves should look like, I now want to create a filled vertical region between these two curves and label it, like so

What's the best way to achieve this effect? I've figured out the following with assistance of comment on this:

\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\pgfplotsset{compat=1.15}
\begin{document}
\begin{center}
\begin{tikzpicture}
\begin{axis}[
axis x line=middle,
axis y line=middle
]
\addplot[color=black,fill=pink,fill opacity=0.4]fill between[of=A and B, soft clip={domain=-1:-0.5}];
\end{axis}
\end{tikzpicture}
\end{center}


How do I put a border on the fill?

• @JouleV I've update the question to ask another bit relating to what I've found. – whitelined Mar 22 at 14:23

JouleV already gave you the crucial hint. The rest is adding patterns, two vertical lines, and a node.

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{patterns}
\usepgfplotslibrary{fillbetween}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}[declare function={f(\x)=1/64*pi^4-pow(\x,4)/4;}]
\begin{axis}[ymax=1.6,
axis x line=middle,
axis y line=middle
]