ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 24 May 2016 14:50:02 -0500Washed out colors when saving plots to filehttp://ask.sagemath.org/question/33540/washed-out-colors-when-saving-plots-to-file/I try to use the `save` command with a view of a 3d plot, like
mypic = implicit_plot3d(x^2 + y^2 + z^2 == distance, (x, -10, 10), (y, -10, 10), (z, -10, 10), opacity = 0.5) + point3d(vector([0, 0, 0]), color = 'red', size = 10)
mypic.save('mypic.png', compress = false)
but the colors (in particular, the opacities) are washed out.
There is no problem right-clicking to save as png from the notebook, but I want to save a bunch of pngs.
Tue, 24 May 2016 11:41:57 -0500http://ask.sagemath.org/question/33540/washed-out-colors-when-saving-plots-to-file/Answer by Maybeso83 for <p>I try to use the <code>save</code> command with a view of a 3d plot, like</p>
<pre><code> mypic = implicit_plot3d(x^2 + y^2 + z^2 == distance, (x, -10, 10), (y, -10, 10), (z, -10, 10), opacity = 0.5) + point3d(vector([0, 0, 0]), color = 'red', size = 10)
mypic.save('mypic.png', compress = false)
</code></pre>
<p>but the colors (in particular, the opacities) are washed out.
There is no problem right-clicking to save as png from the notebook, but I want to save a bunch of pngs.</p>
http://ask.sagemath.org/question/33540/washed-out-colors-when-saving-plots-to-file/?answer=33542#post-id-33542I think when the png is being constructed it doesn't handle the interaction between the opacity of the implicit plot and the point. **Try adjusting your opacity.** I also tested this:
distance = 56; x,y,z = var('x y z')
mypic = implicit_plot3d(x^2 + y^2 + z^2 == distance, (x, -10, 10), (y, -10, 10), (z, -10, 10), opacity = 0.5)
for k in range(-9, 10, 2): mypic = mypic + point3d(vector([5, k, 4]), color = 'red', size = 10)
mypic.save('mypic.png', compress = false)
mypic
The inline image shows a line of six red points from up-left to down-right ( \ ), with a center gap where four are completely blocked by the sphere. The saved png shows all ten points in a line from down-left to up-right ( / ), with the center four slightly hazy. So the png is also swapping x with y for the points (the axis labels are correct). Tue, 24 May 2016 14:50:02 -0500http://ask.sagemath.org/question/33540/washed-out-colors-when-saving-plots-to-file/?answer=33542#post-id-33542