I am trying to create a plot defining the coordinates to express the position of the Sun using pyplot from matplotlib. I am using a transparent blue sky dome (alpha=0.3) and draw an oblique yellow Sun (amongst others; alpha=1.0) after the dome. I made the original figure about two years ago and now wanted to start from there and then improve it. However, when I now make the same plot using the same code, the colour of the solid Sun is affected by that of the dome, even though I draw the Sun after the dome. (The only exception is when I rotate the image so that the word "Sun" sticks out from the dome.) This worked as expected two years ago (left panel); what do I need to do to get the same effect now (right panel)?
Asked
Active
Viewed 80 times
0
-
1I think you forgot to add some reproducible example code. Maybe the algorithm to try to find out an ordering changed a bit? Note that matplotlib only has limited 3D capabilities. Matplotlib's faq suggests to use Mayavi if you need more. See also the discussion at https://stackoverflow.com/questions/37611023/3d-parametric-curve-in-matplotlib-does-not-respect-zorder-workaround which uses `plt.axes(projection='3d',computed_zorder=False)`. – JohanC Apr 15 '22 at 14:13
-
1The change in `zorder` behaviour seems to be the culprit - I didn't know about it. Your hint solves my problem, thanks a lot for that! – AstroFloyd Apr 18 '22 at 09:10