Hello everyone,
I wish a simple sample of creating a pie graph filled with a gradient from blue(#98D0D8) to a lighter blue(#BAE5EB).
Here’s the code (I got from the samples):
from pylab import *
# make a square figure and axes
figure(1, figsize=(6,6))
ax = axes([0.1, 0.1, 0.8, 0.8])
labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
fracs = [15,30,45, 10]
explode=(0, 0.05, 0, 0)
pie(fracs, explode=explode, labels=labels, autopct='%1.1f%%', shadow=True)
title('Raining Hogs and Dogs', bbox={'facecolor':'0.8', 'pad':5})
show()
Thanks.
Unfortunately, there is no simple way, as MPL does not support gradient yet.
There is a hard way though, that you create a gradient image by
yourself and clip it with the appropriate path.
I guess, the easiest way for a normal user is to export the figure as
the SVG format and put some gradient using inkscape, or similar tools.
Regards,
-JJ
···
On Wed, Sep 30, 2009 at 12:21 PM, Gewton Jhames <gjhames@...287...> wrote:
Hello everyone,
I wish a simple sample of creating a pie graph filled with a gradient from
blue(#98D0D8) to a lighter blue(#BAE5EB).
Here's the code (I got from the samples):
from pylab import *
# make a square figure and axes
figure(1, figsize=(6,6))
ax = axes([0.1, 0.1, 0.8, 0.8])
labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
fracs = [15,30,45, 10]
explode=(0, 0.05, 0, 0)
pie(fracs, explode=explode, labels=labels, autopct='%1.1f%%', shadow=True)
title('Raining Hogs and Dogs', bbox={'facecolor':'0.8', 'pad':5})
show()
Thanks.
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
Ok, but there’s a class called map color, I think it goes that way. But I didn’t find a way to create map colors with hexadecimal values, only with r, g, b dicts from 0 to 1.0. I didn’t get it.
I also didn’t find how to apply this map colors to a pie patch.
···
On Sat, Oct 3, 2009 at 10:28 PM, Jae-Joon Lee <lee.j.joon@…287…> wrote:
Unfortunately, there is no simple way, as MPL does not support gradient yet.
There is a hard way though, that you create a gradient image by
yourself and clip it with the appropriate path.
I guess, the easiest way for a normal user is to export the figure as
the SVG format and put some gradient using inkscape, or similar tools.
Regards,
-JJ
On Wed, Sep 30, 2009 at 12:21 PM, Gewton Jhames <gjhames@…287…> wrote:
Hello everyone,
I wish a simple sample of creating a pie graph filled with a gradient from
blue(#98D0D8) to a lighter blue(#BAE5EB).
Here’s the code (I got from the samples):
from pylab import *
make a square figure and axes
figure(1, figsize=(6,6))
ax = axes([0.1, 0.1, 0.8, 0.8])
labels = ‘Frogs’, ‘Hogs’, ‘Dogs’, ‘Logs’
fracs = [15,30,45, 10]
explode=(0, 0.05, 0, 0)
pie(fracs, explode=explode, labels=labels, autopct=‘%1.1f%%’, shadow=True)
title(‘Raining Hogs and Dogs’, bbox={‘facecolor’:‘0.8’, ‘pad’:5})
show()
Thanks.
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users