3

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.

1
  • do you mean something like inner color=white, outer color=red!80? (pass this as an option for plane/.style instead of fill=red!80)
    – Troy
    May 30, 2017 at 9:09

1 Answer 1

2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.