# TikZ: rotating scope changes shading

As a follow-up to this question, Saturn has a tilt of 26°. But when I tilt Saturn, the colors of the rings change.

\documentclass{article}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\begin{scope}[rotate=26.73]
% Top half
\fill [gray!30] (0:1) arc (0:180:1) -- cycle;

% Ring
\path[inner color=black,outer color=yellow!20,even odd rule]

% Bottom half
\fill [gray!30] (180:1) arc (180:360:1) -- cycle;
\end{scope}
\end{tikzpicture}
\end{document}


Here is what I get with rotate=0 and rotate=26.73.

And what I'm trying to get

How can I get the rings to rotate without changing their color? How do I rotate the shading along with the object?

I tried to add shading angle=26.73, but the colors are still off:

\begin{tikzpicture}
\begin{scope}[rotate=26.73]
% Top half
\fill [gray!30] (0:1) arc (0:180:1) -- cycle;

% Ring
\path[inner color=black,outer color=yellow!20, even odd rule, shading angle=26.73]

% Bottom half
\fill [gray!30] (180:1) arc (180:360:1) -- cycle;
\end{scope}
\end{tikzpicture}


also results in

• If you draw only the rings, for example, you will see that it is a circular shading and so, shading rotations does not change the visual (a rotate circle is a circle again :-)). So, try to use linear shadings. Apr 17, 2020 at 11:44
• @Sigur How would I go about with linear shadings to get the same aspect as in the first image? Apr 17, 2020 at 13:54

Is \rotatebox acceptable?

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\rotatebox{26.73}{%
\begin{tikzpicture}
% Top half
\fill [gray!30] (0:1) arc (0:180:1) -- cycle;

% Ring
\path[inner color=black,outer color=yellow!20,even odd rule]

% Bottom half
\fill [gray!30] (180:1) arc (180:360:1) -- cycle;
\end{tikzpicture}%
}
\end{document}


## EDIT

Well, understood. You can include your entire code inside a node:

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
% Top half
\node[rotate=26.37] at (0,0) {%
\begin{tikzpicture}
\fill [gray!30] (0:1) arc (0:180:1) -- cycle;

% Ring
\path[inner color=black,outer color=yellow!20,even odd rule]

% Bottom half
\fill [gray!30] (180:1) arc (180:360:1) -- cycle;
\end{tikzpicture}
};
\end{tikzpicture}%
\end{document}


• I have other things going on in the tikzpicture that I don't want rotated, so this doesn't quite cut it Apr 17, 2020 at 13:09
• I include another solution working inside the TikZ environment, in case it helps
– user193767
Apr 17, 2020 at 20:13

Here is a solution:

\documentclass[tikz]{standalone}
\begin{document}
\foreach \tilt in {-21.6,-21.2,...,21.6,21.2,20.8,...,-21.2}{
\begin{tikzpicture}
\fill[white] (-2.3,-1.3) rectangle (2.3,1.3);
\begin{scope}[rotate=\tilt]
% Top half
\fill [gray!30] (0:1) arc (0:180:1) -- cycle;
\colorlet{yellowhite}{yellow!20!white}
]in {1.5,1.52,...,1.8,1.98,2.00,...,2.28} {
\fill[fill=yellowhite!\cprop!black,even odd rule]