SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Gewton J. <gj...@gm...> - 2009年09月30日 16:21:58
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.
From: Jae-Joon L. <lee...@gm...> - 2009年10月04日 01:28:33
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 <gj...@gm...> 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&reg; 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&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Gewton J. <gj...@gm...> - 2009年10月04日 11:32:45
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...@gm...> 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 <gj...@gm...> 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&reg; 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&#45;12, 2009. Register
> now&#33;
> > http://p.sf.net/sfu/devconf
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
> >
>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /