Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Color cycle handling #6291
Conversation
mdboom
added the
needs_review
label
Apr 11, 2016
mdboom
added this to the
2.0 (style change major release)
milestone
Apr 11, 2016
QuLogic
commented on the diff
Apr 11, 2016
QuLogic
and 1 other
commented on an outdated diff
Apr 11, 2016
QuLogic
commented on the diff
Apr 11, 2016
| @@ -113,9 +116,14 @@ def _process_plot_format(fmt): | ||
| raise ValueError( | ||
| 'Illegal format string "%s"; two color symbols' % fmt) | ||
| color = c | ||
| + elif c == 'C' and i < len(chars) - 1: | ||
| + color_cycle_number = int(chars[i + 1]) |
QuLogic
Member
|
QuLogic
and 1 other
commented on an outdated diff
Apr 11, 2016
|
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. |
mdboom
added some commits
Apr 11, 2016
tacaswell
commented on the diff
Apr 14, 2016
| @@ -3846,7 +3853,10 @@ def scatter(self, x, y, s=None, c=None, marker='o', cmap=None, norm=None, | ||
| if facecolors is not None: | ||
| c = facecolors | ||
| else: | ||
| - c = 'b' # The original default | ||
| + if rcParams['_internal.classic_mode']: | ||
| + c = 'b' # The original default | ||
| + else: | ||
| + c = self._get_patches_for_fill.get_next_color() |
tacaswell
Owner
|
QuLogic
added the
default changes
label
Apr 14, 2016
jenshnielsen
commented on an outdated diff
Apr 25, 2016
| @@ -867,7 +867,7 @@ def validate_animation_writer_path(p): | ||
| ## patch props | ||
| '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) |
|
|
|
This is related to #6328. |
tacaswell
merged commit 8af02b3
into matplotlib:master
Apr 28, 2016
tacaswell
removed the
needs_review
label
Apr 28, 2016
|
backported to v2.x as e524354 |
mdboom commentedApr 11, 2016
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.