[Tex/LaTex] TikZ: shade plane with a colour gradient

gradienttikz-pgf

I was wondering how I could shade this given plane:

\begin{tikzpicture}
    [plane/.style={trapezium,draw,fill=red!80,trapezium left angle=60,trapezium right angle=120,minimum height=1.5cm},scale=1.0]
    \node (p)[plane] at (0,0){.};
    \draw (p.center) edge ++(0,2cm) edge[densely dashed] (p.south) (p.south) edge ++(0,-1cm);
    \draw (-.25,-.125) node[above]{$P$} (0,0);
\end{tikzpicture}

from white at the Center (0,0) to red!80 at the edges.

Best Answer

If you would like to add shading to your plane, the simplest way is to just set the inner color and outer color to its respective colours, instead of using fill, like so:

\documentclass[tikz,border=2]{standalone}
\usetikzlibrary{shapes.geometric}
\begin{document}
    \begin{tikzpicture}
    [plane/.style={trapezium,draw,inner color=white,outer color=red!80,trapezium left angle=60,trapezium right angle=120,minimum height=1.5cm},scale=1.0]
    \node (p)[plane] at (0,0){.};
    \draw (p.center) edge ++(0,2cm) edge[densely dashed] (p.south) (p.south) edge ++(0,-1cm);
    \draw (-.25,-.125) node[above]{$P$} (0,0);
    \end{tikzpicture}
\end{document}

shading