File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -592,6 +592,8 @@ class HandlerPolyCollection(HandlerBase):
592592 """
593593 def _update_prop (self , legend_handle , orig_handle ):
594594 def first_color (colors ):
595+ if colors is None :
596+ return None
595597 colors = mcolors .to_rgba_array (colors )
596598 if len (colors ):
597599 return colors [0 ]
@@ -602,8 +604,12 @@ def get_first(prop_array):
602604 return prop_array [0 ]
603605 else :
604606 return None
605- legend_handle .set_edgecolor (first_color (orig_handle .get_edgecolor ()))
606- legend_handle .set_facecolor (first_color (orig_handle .get_facecolor ()))
607+ edgecolor = getattr (orig_handle , '_original_edgecolor' ,
608+ orig_handle .get_edgecolor ())
609+ legend_handle .set_edgecolor (first_color (edgecolor ))
610+ facecolor = getattr (orig_handle , '_original_facecolor' ,
611+ orig_handle .get_facecolor ())
612+ legend_handle .set_facecolor (first_color (facecolor ))
607613 legend_handle .set_fill (orig_handle .get_fill ())
608614 legend_handle .set_hatch (orig_handle .get_hatch ())
609615 legend_handle .set_linewidth (get_first (orig_handle .get_linewidths ()))
You can’t perform that action at this time.
0 commit comments