Re: [Matplotlib-users] pie colors
On Wed, Nov 30, 2011 at 7:43 PM, Benjamin Root ben.r...@ou.edu wrote: As an additional note, would it be a desirable feature to be able to cycle hash styles in the case of producing bw plots? Ben Root Ben, I think this would be quite useful. How are you thinking of implementing it? Cycling through lines = ['-', '--', '-.', etc] or through dashes = [(20,10), (5,5), (30,7), etc]? -paul -- Learn Windows Azure Live! Tuesday, Dec 13, 2011 Microsoft is holding a special Learn Windows Azure training event for developers. It will provide a great way to learn Windows Azure and what it provides. You can attend the event by watching it streamed LIVE online. Learn more at http://p.sf.net/sfu/ms-windowsazure ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] pie colors
On Wed, Nov 30, 2011 at 10:34 AM, Grigoris Maravelias gr.maravel...@gmail.com wrote: Hello list! I have a question regarding the colors of the pie diagram of matplotlib. When no colors are assigned then the pie function automatically selects some colors, like the example image I have attached. But in this case the black color covers the text. How can we avoid this?Is there an easy (perhaps?) way to exclude a color? I don't really use pie charts, but I think it just uses the default color cycle. This can be altered by changing the rcParams: import matplotlib.pyplot as plt plt.rcParams['axes.color_cycle'].remove('k') The color_cycle parameter is just a python list, so I use list.remove to remove black (which is the letter 'k' since 'b' is blue). There are other ways of setting rcParams, as detailed in the help fileshttp://matplotlib.sourceforge.net/users/customizing.html(Note that `rc` and `rcParams` is in both matplotlib.pyplot and the main matplotlib package). Best, -Tony -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] pie colors
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. Thanks though for the help! Regards Grigoris On 11/30/2011 06:09 PM, Tony Yu wrote: On Wed, Nov 30, 2011 at 10:34 AM, Grigoris Maravelias gr.maravel...@gmail.com mailto:gr.maravel...@gmail.com wrote: Hello list! I have a question regarding the colors of the pie diagram of matplotlib. When no colors are assigned then the pie function automatically selects some colors, like the example image I have attached. But in this case the black color covers the text. How can we avoid this?Is there an easy (perhaps?) way to exclude a color? I don't really use pie charts, but I think it just uses the default color cycle. This can be altered by changing the rcParams: import matplotlib.pyplot as plt plt.rcParams['axes.color_cycle'].remove('k') The color_cycle parameter is just a python list, so I use list.remove to remove black (which is the letter 'k' since 'b' is blue). There are other ways of setting rcParams, as detailed in the help files http://matplotlib.sourceforge.net/users/customizing.html (Note that `rc` and `rcParams` is in both matplotlib.pyplot and the main matplotlib package). Best, -Tony -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] pie colors
On Wed, Nov 30, 2011 at 6:31 PM, Grigoris Maravelias gr.maravel...@gmail.com 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 -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] pie colors
On Wednesday, November 30, 2011, Tony Yu tsy...@gmail.com wrote: On Wed, Nov 30, 2011 at 6:31 PM, Grigoris Maravelias gr.maravel...@gmail.com 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 Just making a note to myself. I have bits and pieces of a property cycling mechanism (originally to cycle line styles). I am finding that cycling is very inconsistent throughout mpl, and I should probably add pie() to that list as well. As an additional note, would it be a desirable feature to be able to cycle hash styles in the case of producing bw plots? Ben Root -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users