I want to fill an area on a x–y plane with fading color, but have no idea how to do it. I know how to fill shapes with color, but not how to do it when the area is not a well defined shape.
Let me be more specific:
I drew a rough sketch of the implicit function y^2-x^2=a^2:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{tikzpicture}
\draw[->] (-3,0) -- (3,0) node[right] {$x$};
\draw[->] (0,-3) -- (0,3) node[above] {$y$};
\draw (-3,3) parabola bend (0,1.25) (3,3);
\draw (-3,-3) parabola bend (0,-1.25) (3,-3);
\end{tikzpicture}
\end{center}
\end{document}
This produces the following:
Now I want to fill the area that enclosed between these two parabolas with a color that fades away at the right and left edges (to emphasize the fact that the area goes further away to infinity).
Can it be done?
Thanks in advanced!
Best Answer
May be you should use
pgfplots
which offersfill between
facility. But here is atikz
version:Using
pgfplots
and itsfillbetween
library, your code would look something like:And the result: