指定此区域进行着色

指定此区域进行着色

我有一组弯曲轴的图。

我想要从中心开始着色外轴上的圆圈逐渐变为白色。使用center=red将阴影的中心放在阴影区域的中心,而不是图表的中心,我无法组合top color=red, left color=red, right color=white, bottom color=white

如何使用 TikZ 实现此目的?我当前的 MWE 如下。 在此处输入图片描述

\documentclass[class=minimal,border=0pt]{standalone}
\usepackage{textcomp}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}

\shade [top color=red] (0,0) -- (6:5) arc (6:-140:5) -- (0,0);
\draw [color=blue] plot [smooth] coordinates {(0,0) (-28:1) (-56:2) (-84:3) (-112:4) (-140:5)};  \fill [fill=white] plot [smooth] coordinates {(0,0) (-28:1) (-56:2) (-84:3) (-112:4) (-140:5)};

\foreach \i in {5,...,1} {
    \node [anchor=south] at (10:\i) {W\i};
    \draw [black, dashed, very thin] ++(10:\i) arc (10:-195:\i);
}

\foreach \i in {0,...,3} {
    \pgfmathsetmacro\angleresult{\i * -60 };
    \pgfmathsetmacro\mylabel{\i * 60 };
    \draw [gray, dashed] (0,0) -- (\angleresult:5.5);
    \node [anchor=north] at (\angleresult:5.5) {\mylabel\textdegree};
}

\draw [black, very thick](0,0) -- (6:5);

\end{tikzpicture}%
\end{document}

答案1

你想要这样的东西吗?

阴影

\documentclass[tikz,border=5pt]{standalone}
\usepackage{textcomp}
\begin{document}
  \begin{tikzpicture}

    \begin{scope}
        \clip (0,0) -- (6:5) arc (6:-140:5) -- (0,0);
        \shade [inner color=red, outer color=white] (0,0) circle (5);
    \end{scope}

    \draw [color=blue] plot [smooth] coordinates {(0,0) (-28:1) (-56:2) (-84:3) (-112:4) (-140:5)};  \fill [fill=white] plot [smooth] coordinates {(0,0) (-28:1) (-56:2) (-84:3) (-112:4) (-140:5)};

    \foreach \i in {5,...,1} {
      \node [anchor=south] at (10:\i) {W\i};
      \draw [black, dashed, very thin] ++(10:\i) arc (10:-195:\i);
    }

    \foreach \i in {0,...,3} {
      \pgfmathsetmacro\angleresult{\i * -60 };
      \pgfmathsetmacro\mylabel{\i * 60 };
      \draw [gray, dashed] (0,0) -- (\angleresult:5.5);
      \node [anchor=north] at (\angleresult:5.5) {\mylabel\textdegree};
    }

    \draw [black, very thick](0,0) -- (6:5);

  \end{tikzpicture}%
\end{document}

相关内容