From: Tony Yu <ts...@gm...> - 2011-12-01 02:51:07
|
On Wed, Nov 30, 2011 at 6:31 PM, Grigoris Maravelias < gr....@gm...> wrote: > ** > Well I did tried this but it didn't work out. It actually removes the > black color from the color_cycle but the pie still prints it. Moreover I > noticed that this color_cycle has 7 colors that repeats after the first 7 > so it won't do what I want. I will need to find another way to set the > colors or just avoid the pie. > > I guess I should atleast read the docstring for plt.pie before giving you advice on how to use it. It looks like the default colors are hard coded into the function (instead of using the color_cycle parameter). The quickest way to create different colors is to pick them out from a colormap. For example, the following gives decent results: >>> colors = plt.cm.Set1(np.linspace(0,1,9)) >>> plt.pie(np.ones(9), colors=colors) Of course, trying to get more (visually-differentiable) colors out of the color map will be difficult. Hope that helps, -Tony |