答案1
这是 TikZ 库的一个小窍门shading
。我不知道如何旋转彩虹的颜色。
% with Nguyen Quang Dung
\documentclass[tikz,border=5mm]{standalone}
\usetikzlibrary{shadings}
\begin{document}
\begin{tikzpicture}
% decorations
\def\a{1.1} \def\b{.03}
\draw[gray,nodes={black,scale=.5}]
(0,-\a) node[below]{$0$} node[below=4mm]{$x$}
(1,-1-\b)--(1,-\a) node[below]{$1$}
(-1,-1-\b)--(-1,-\a) node[below]{$-1$}
(-\a,0) node[left]{$0$} node[left=4mm]{$y$}
(-1-\b,1)--(-\a,1) node[left]{$1$}
(-1-\b,-1)--(-\a,-1) node[left]{$-1$};
\draw
(-\a,0)--(\a,0) (0,\a)--(0,-\a)
(-\a,-\a) rectangle(\a,\a);
% now shading
\shade[shading=color wheel,even odd rule]
(0,0) circle (1)
(0,0) circle (.98);
\end{tikzpicture}
\end{document}