Conversation
| 4) as a string representing a floating point number | ||
| from 0 to 1, corresponding to shades of gray. | ||
|
|
||
| 5) as a special color "Cn", where n is a number 0-9 specifying the |
There was a problem hiding this comment.
The sentence above should be updated to say 5 ways.
There was a problem hiding this comment.
Thanks for noticing. Done.
|
I assume the test image was not intended to have changed colours. |
Indeed it was intentional. That test is testing a linestyle-only color cycle. Since it has no colors, it defaults to black, which is a more sensible default than the old blue. |
| if rcParams['_internal.classic_mode']: | ||
| c = 'b' # The original default | ||
| else: | ||
| c = self._get_patches_for_fill.get_next_color() |
There was a problem hiding this comment.
Yeah, that is the only other plausibly defensible position.
My only reservation is that we have pushed back on this suggestion for so long and that in most cases if you are not mapping the color you probably want to be using plot(x, y, 'o') instead.
That said, I have no real protest with this.
lib/matplotlib/rcsetup.py
Outdated
| 'patch.linewidth': [None, validate_float_or_None], # line width in points | ||
| 'patch.edgecolor': ['k', validate_color], # black | ||
| 'patch.facecolor': ['#1f77b4', validate_color], # blue (first color in color cycle) | ||
| 'patch.facecolor': ['C0', validate_color], # blue (first color in color cycle) |
There was a problem hiding this comment.
Delete blue in the comment here?
|
This is related to #6328. |
|
backported to v2.x as e524354 |
Replaces #5674.
This uses the color cycle in more places.
It also introduces
Cnsyntax for colors to directly address the Nth element in a color cycle. This was chosen over the[n]syntax in #5674 because it makes it more obvious that it's color-specific and can only be used in places where colors can be used.