-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Improve color cycle usage #5674
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
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
13e98b4
Use Vega collection10 colors instead
mdboom cebbe40
Fix #5577: Use the color cycle in more places
mdboom 4386e35
Fix #5489: feature for specifying N in color cycle
mdboom 8d8ccb6
Fix merge
mdboom 3724751
PEP8
mdboom e702bc3
Update test images
mdboom 1013ed8
Lookup color in backward-compatible way
mdboom 140d0ab
Support [N] syntax in rcParams file
mdboom 91906bc
Handle bytes and unicode
mdboom 011f9fa
Fix logic
mdboom 350a66a
Rename variable
mdboom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
|
||
from matplotlib.externals import six | ||
from matplotlib.externals.six.moves import zip | ||
from matplotlib import rcParams | ||
|
||
# Original version by Yannick Copin (ycopin@ipnl.in2p3.fr) 10/2/2010, available | ||
# at: | ||
|
@@ -770,11 +771,15 @@ def _get_angle(a, r): | |
print("lrpath\n", self._revert(lrpath)) | ||
xs, ys = list(zip(*vertices)) | ||
self.ax.plot(xs, ys, 'go-') | ||
patch = PathPatch(Path(vertices, codes), | ||
fc=kwargs.pop('fc', kwargs.pop('facecolor', | ||
'#bfd1d4')), # Custom defaults | ||
lw=kwargs.pop('lw', kwargs.pop('linewidth', 0.5)), | ||
**kwargs) | ||
if rcParams['_internal.classic_mode']: | ||
fc = kwargs.pop('fc', kwargs.pop('facecolor', '#bfd1d4')) | ||
lw = kwargs.pop('lw', kwargs.pop('linewidth', 0.5)) | ||
else: | ||
fc = kwargs.pop('fc', kwargs.pop('facecolor', None)) | ||
lw = kwargs.pop('lw', kwargs.pop('linewidth', None)) | ||
if fc is None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a path through this where fc is never defined. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops. Fixed. |
||
fc = six.next(self.ax._get_patches_for_fill.prop_cycler)['color'] | ||
patch = PathPatch(Path(vertices, codes), fc=fc, lw=lw, **kwargs) | ||
self.ax.add_patch(patch) | ||
|
||
# Add the path labels. | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+1.34 KB
(110%)
lib/matplotlib/tests/baseline_images/test_artist/default_edges.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.64 KB
(120%)
lib/matplotlib/tests/baseline_images/test_cycles/lineprop_cycle_basic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably note that negative indexes are not allowed (as evidenced by the regex used).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I should also mention the fact that it wraps around.