Shadows are really large in exported PNG file

I’m trying to create a pie chart for a presentation. If I turn on shadows, they look fine on the screen (in an IPython notebook), but when I export the file to a PNG file, the shadow is way larger, and looks pretty ugly. Is this a bug? And is there a way to shrink the size of the shadow?

Here’s some sample code that shows the problem:

import matplotlib.pyplot as plt
numbers = [4380.0, 2474.0, 158]
explode=(0, 0, 0.5)
plt.pie(numbers, explode=explode,shadow=True)
plt.axis('equal')
plt.savefig(‘grap.png’, dpi=400)

Thanks for any suggestions.

By the way, I’m using Matplotlib version 1.4.3 with the Anaconda distribution under OS X.

Richard Stanton

A quick follow-up: if I export to a jpg file, I get the same huge shadow. If I export to a PDF file, the shadow looks much more like it does on the screen.

···

On Sep 3, 2015, at 1:07 PM, Richard Stanton <stanton@...4358...> wrote:

I’m trying to create a pie chart for a presentation. If I turn on shadows, they look fine on the screen (in an IPython notebook), but when I export the file to a PNG file, the shadow is way larger, and looks pretty ugly. Is this a bug? And is there a way to shrink the size of the shadow?

Here’s some sample code that shows the problem:

import matplotlib.pyplot as plt
numbers = [4380.0, 2474.0, 158]
explode=(0, 0, 0.5)
plt.pie(numbers, explode=explode,shadow=True)
plt.axis('equal')
plt.savefig(‘grap.png’, dpi=400)

Thanks for any suggestions.

By the way, I’m using Matplotlib version 1.4.3 with the Anaconda distribution under OS X.

Richard Stanton

For those who wonder what he means:
PastedGraphic-38.png

on the left is TkAgg; on the right is png.

-Sterling

···

On Sep 3, 2015, at 1:13PM, Richard Stanton <stanton@…4358…> wrote:

A quick follow-up: if I export to a jpg file, I get the same huge shadow. If I export to a PDF file, the shadow looks much more like it does on the screen.

On Sep 3, 2015, at 1:07 PM, Richard Stanton <stanton@…4358…> wrote:

I’m trying to create a pie chart for a presentation. If I turn on shadows, they look fine on the screen (in an IPython notebook), but when I export the file to a PNG file, the shadow is way larger, and looks pretty ugly. Is this a bug? And is there a way to shrink the size of the shadow?

Here’s some sample code that shows the problem:

import matplotlib.pyplot as plt
numbers = [4380.0, 2474.0, 158]
explode=(0, 0, 0.5)
plt.pie(numbers, explode=explode,shadow=True)
plt.axis(‘equal’)
plt.savefig(‘grap.png’, dpi=400)

Thanks for any suggestions.

By the way, I’m using Matplotlib version 1.4.3 with the Anaconda distribution under OS X.

Richard Stanton


Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140


Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

This appears to be DPI dependent.

Changing the last line of Richard's example to

plt.savefig("grap.png")

gives a PNG with a shadow similar to that generated by TkAgg.

--Mark

···

On 09/03/2015 01:17 PM, Sterling Smith wrote:

For those who wonder what he means:
on the left is TkAgg; on the right is png.

-Sterling

On Sep 3, 2015, at 1:13PM, Richard Stanton <stanton@…4358… > <mailto:stanton@…4358…>> wrote:

A quick follow-up: if I export to a jpg file, I get the same huge shadow. If I
export to a PDF file, the shadow looks much more like it does on the screen.

On Sep 3, 2015, at 1:07 PM, Richard Stanton <stanton@…4358… >>> <mailto:stanton@…4358…>> wrote:

I�m trying to create a pie chart for a presentation. If I turn on shadows,
they look fine on the screen (in an IPython notebook), but when I export the
file to a PNG file, the shadow is way larger, and looks pretty ugly. Is this
a bug? And is there a way to shrink the size of the shadow?

Here�s some sample code that shows the problem:

import matplotlib.pyplot as plt
numbers = [4380.0, 2474.0, 158]
explode=(0, 0, 0.5)
plt.pie(numbers, explode=explode,shadow=True)
plt.axis('equal')
plt.savefig(�grap.png�, dpi=400)

Thanks for any suggestions.

By the way, I�m using Matplotlib version 1.4.3 with the Anaconda distribution
under OS X.

Richard Stanton

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users