Skip to content

Instantly share code, notes, and snippets.

@duncanmmacleod
Created October 4, 2014 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duncanmmacleod/91976ed41b20c48c5c87 to your computer and use it in GitHub Desktop.
Save duncanmmacleod/91976ed41b20c48c5c87 to your computer and use it in GitHub Desktop.
matplotlib.collections.PatchCollection() shouldn't ignore all kwargs if match_original=True
diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py
index 9e25ca0..5065834 100644
--- a/lib/matplotlib/collections.py
+++ b/lib/matplotlib/collections.py
@@ -1527,21 +1527,13 @@ class PatchCollection(Collection):
return patch.get_facecolor()
return [0, 0, 0, 0]
- facecolors = [determine_facecolor(p) for p in patches]
- edgecolors = [p.get_edgecolor() for p in patches]
- linewidths = [p.get_linewidth() for p in patches]
- linestyles = [p.get_linestyle() for p in patches]
- antialiaseds = [p.get_antialiased() for p in patches]
-
- Collection.__init__(
- self,
- edgecolors=edgecolors,
- facecolors=facecolors,
- linewidths=linewidths,
- linestyles=linestyles,
- antialiaseds=antialiaseds)
- else:
- Collection.__init__(self, **kwargs)
+ kwargs['facecolors'] = [determine_facecolor(p) for p in patches]
+ kwargs['edgecolors'] = [p.get_edgecolor() for p in patches]
+ kwargs['linewidths'] = [p.get_linewidth() for p in patches]
+ kwargs['linestyles'] = [p.get_linestyle() for p in patches]
+ kwargs['antialiaseds'] = [p.get_antialiased() for p in patches]
+
+ Collection.__init__(self, **kwargs)
self.set_paths(patches)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment