TikZ:具有颜色渐变的阴影平面

TikZ:具有颜色渐变的阴影平面

我想知道如何为这个给定的平面着色:

\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}

white中心(0,0)red!80边缘。

答案1

如果您想为 添加阴影plane,最简单的方法就是将inner color和设置outer color为各自的颜色,而不是使用fill,如下所示:

\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}

阴影

相关内容