領域の外側をシェーディングする方法

領域の外側をシェーディングする方法

半円から離れるにつれて色が薄くなるように、X 軸に垂直な半円の外側を陰影付けするにはどうすればよいでしょうか? ご協力ありがとうございます!

\begin{tikzpicture}
\draw[blue] (-1,0) .. controls (-1,0.555) and (-0.555,1) .. (0,1)
.. controls (0.555,1) and (1,0.555) .. (1,0);
\draw (-2,0) -- (2,0);
\end{tikzpicture}

答え1

これは少しばかげているかもしれませんが、あなたが求めていることは実現できるでしょう。

出力

ここに画像の説明を入力してください

コード

\documentclass[tikz,border=5pt]{standalone}
\begin{document}
\begin{tikzpicture}
  \def\ymax{3}
  \def\xmax{3}
  \begin{scope}
    \clip (-\xmax, 0) rectangle (\xmax, \ymax) ;
    \shade[inner color=red,outer color=white] (0,0) circle (3);
    \draw[blue, fill=white] (0,0) circle (1) ;
  \end{scope}
  \draw [thick, ->] (-\xmax,0) -- (\xmax,0) ;
\end{tikzpicture}
\end{document}

関連情報