-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Change default color cycle #4754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I like: http://colorbrewer2.org/?type=qualitative&scheme=Dark2&n=8 or http://colorbrewer2.org/?type=qualitative&scheme=Dark2&n=7 depending on how many colors we want in the cycle (currently at 7) |
Dark2 is quite good, I usually use Set2. Does it have to stay a 7 colors cycle or would it be better to increase the number? |
Absolutely, we can change the number of colors to use. Also keep in mind On Wed, Jul 22, 2015 at 11:26 AM, Gilles Marin [email protected]
|
This could be done using the cycler plugin (or somthing in that line)? I heard about that but did not look into it. Will it be able to cycle every parameter? |
Entirely minor point, but I like Seaborn's color cycle because when I plot u,g,r,i,z light curves in that order, the colors make sense 😄 In fact, I'd be perfectly happy if the community just decided to make Seaborn's default the new matplotlib style default. |
Still ironing out the bugs, but this is my PR for it: On Wed, Jul 22, 2015 at 11:32 AM, Gilles Marin [email protected]
|
This is a great idea. One related problem that I have when using seaborn is that although it changes the default colors in the color cycle it does not change the colors corresponding to the abbreviated color names (e.g. 'r', 'g', 'b', etc). Thus if you want to make a plot specifying which data should be red for example, you cannot just do "seaborn.plt.plot(mydata, 'r')", since that gives the "wrong" red color (i.e. not the one used in the default color cycle). I think that if the default color cycle were changed, the colors that correspond to the main color abbreviatons (and perhaps their non abbreviated forms, e.g. 'red', 'blue', etc) should be changed to match the corresponding colors in the color cycle. Ideally the colors corresponding to these "base" colors should be settable via rcParams so that styles and users can modify them as well. Maybe this deserves its own issue? I did not create one because I've seen this mentioned in some other issues, but I have not found an issue open specifically for this. |
One thing that has come up before related to this is that, if the color cycle is going to stay roughly as it is or some seaborn-like variant, it might make sense to swap red and green in the order, as blue vs red is an easier discrimination than blue vs green. This will help two-element plots. By the way, @AngelEzquerra,
As of 0.6 you can do either |
There is discussion of changing the mapping of r, g, b etc. However, making the mapping user configurable is a bit scary (even though I want to make switching to the xkcd color mapping from the x11 names optional). |
@mwaskom the set_color_codes('deep') trick works great, and as you said it works exactly as I expected! Is there a reason why this is not the default? It makes so munch more sense (IMHO). Regarding the reordering of the green and read in the color cycle, this touches on something that I have been also thinking about, which is how color blind friendly the new palettes and colors are. Ideally the default matplotlib styles should be both aesthetically pleasing and color blind friendly (and if possible, degrade nicely when printing in grayscale). Combining all those desirable features is possibly quite hard though!
I have a question and a comment:
|
I agree, but when I proposed that I got a lot of pushback from the matplotlib devs, so I punted on making it default for 0.6 :)
In my experience, it's quite hard to make qualitative palettes that reproduce well to grayscale, and often runs counter to your goals with a qualitative palette (i.e., you have to vary luminance, which has the effect of emphasizing certain categories over others, but without any sense of ordering that emphasis ends up being arbitrary). I think the better solution if you want to be sure that your plots will be accessible and reproduce to grayscale is to vary other attributes, such as linestyle/markershape along with color. I think |
I find 7 colors quite limiting, and think it'd be great if more could be added. I use my own colormap with 9 colors and still occasionally run into situations where I run out of colors. On a different note, I find seaborn's default colors nicer than ColorBrewer's Dark2 that was proposed here. (just my 2 cents as mpl user) |
I am not too fond of the ColorBrewer Dark2 for this purpose and think that seaborn or Tableau's color cycles are a better starting point. |
Coming late to the party but it would be great if one could easily change the number of colors to cycle. I don't know if there is currently a way to easily make a plot with 8 lines without using the same color twice. |
Regarding changing the default 'r', 'g', 'b' etc... If the devs think it's too scary to make these abbreviations user configurable, why not at least include some different 'abbreviation palettes' (chosen with rc params!) that have nice colors but don't commit crimes like mapping 'y' to blue. |
I have been thinking that a "palette" feature would be nice. Kind of goes On Thu, Aug 20, 2015 at 1:13 PM, Julian Irwin [email protected]
|
+1 to a customizable palette feature! |
There are two questions here:
For mpl2.0 we have to address 1, but do not need to address 2. Created new issue to track 2 #4974 |
Closing this as we went with category10 https://github.com/vega/vega/wiki/Scales#scale-range-literals from vega as the new default cycle. 👎 on changing the meaning of 'r' , 'g', etc.... #4383 will add many more named colors (lifted from the XKCD color survey*. Point 2 already has it's own issue. |
@tacaswell what do I do if I have 11 values ;) will it be possible to use, say category20, too? |
This is not yet a PR because I thought it might be good to discuss this first, but the default color cycle for plots uses very harsh primary colors. Would people be open to changing the default color cycle to something more esthetically pleasing such as one of the ones from colorbrewer2 or something similar to what seaborn uses? (we could keep the same main colors but simply make them prettier?)
Here's a seaborn example:
The text was updated successfully, but these errors were encountered: