@@ -3509,7 +3509,9 @@ def _fix_sticky_edges(self, objs, axis, *args, only=None):
35093509 edges .extend (convert ((min_ , max_ )))
35103510
35113511 @staticmethod
3512- def _fix_patch_edges (obj , edgefix = None , ** kwargs ):
3512+ def _fix_patch_edges (
3513+ obj , edgefix = None , default_linewidth : float | None = None , ** kwargs
3514+ ):
35133515 """
35143516 Fix white lines between between filled patches and fix issues
35153517 with colormaps that are transparent. If keyword args passed by user
@@ -3520,7 +3522,11 @@ def _fix_patch_edges(obj, edgefix=None, **kwargs):
35203522 # See: https://github.com/jklymak/contourfIssues
35213523 # See: https://stackoverflow.com/q/15003353/4970632
35223524 edgefix = _not_none (edgefix , rc .edgefix , True )
3523- linewidth = EDGEWIDTH if edgefix is True else 0 if edgefix is False else edgefix
3525+ linewidth = (
3526+ _not_none (default_linewidth , EDGEWIDTH )
3527+ if edgefix is True
3528+ else 0 if edgefix is False else edgefix
3529+ )
35243530 if not linewidth :
35253531 return
35263532 keys = ("linewidth" , "linestyle" , "edgecolor" ) # patches and collections
@@ -3557,7 +3563,9 @@ def _fix_patch_edges(obj, edgefix=None, **kwargs):
35573563 obj .set_edgecolor (obj .get_facecolor ())
35583564 elif np .iterable (obj ): # e.g. silent_list of BarContainer
35593565 for element in obj :
3560- PlotAxes ._fix_patch_edges (element , edgefix = edgefix )
3566+ PlotAxes ._fix_patch_edges (
3567+ element , edgefix = edgefix , default_linewidth = default_linewidth
3568+ )
35613569 else :
35623570 warnings ._warn_ultraplot (
35633571 f"Unexpected obj { obj } passed to _fix_patch_edges."
@@ -5756,7 +5764,9 @@ def _apply_fill(
57565764 # No synthetic tagging or seaborn-based label overrides
57575765
57585766 # Patch edge fixes
5759- self ._fix_patch_edges (obj , ** edgefix_kw , ** kw )
5767+ self ._fix_patch_edges (
5768+ obj , default_linewidth = rc ["patch.linewidth" ], ** edgefix_kw , ** kw
5769+ )
57605770
57615771 # Track sides for sticky edges
57625772 xsides .append (x )
@@ -6039,7 +6049,9 @@ def _apply_bar(
60396049 if isinstance (obj , mcontainer .BarContainer ):
60406050 self ._add_bar_labels (obj , orientation = orientation , ** bar_labels_kw )
60416051
6042- self ._fix_patch_edges (obj , ** edgefix_kw , ** kw )
6052+ self ._fix_patch_edges (
6053+ obj , default_linewidth = rc ["patch.linewidth" ], ** edgefix_kw , ** kw
6054+ )
60436055 for y in (b , b + h ):
60446056 self ._inbounds_xylim (extents , x , y , orientation = orientation )
60456057
@@ -6162,7 +6174,9 @@ def pie(self, x, explode, *, labelpad=None, labeldistance=None, **kwargs):
61626174 ** kw ,
61636175 )
61646176 objs = tuple (cbook .silent_list (type (seq [0 ]).__name__ , seq ) for seq in objs )
6165- self ._fix_patch_edges (objs [0 ], ** edgefix_kw , ** wedge_kw )
6177+ self ._fix_patch_edges (
6178+ objs [0 ], default_linewidth = rc ["patch.linewidth" ], ** edgefix_kw , ** wedge_kw
6179+ )
61666180 return objs
61676181
61686182 @staticmethod
@@ -7074,7 +7088,9 @@ def _apply_hist(
70747088 kw = self ._parse_cycle (n , ** kw )
70757089 obj = self ._call_native ("hist" , xs , orientation = orientation , ** kw )
70767090 if histtype .startswith ("bar" ):
7077- self ._fix_patch_edges (obj [2 ], ** edgefix_kw , ** kw )
7091+ self ._fix_patch_edges (
7092+ obj [2 ], default_linewidth = rc ["patch.linewidth" ], ** edgefix_kw , ** kw
7093+ )
70787094 # Revert to mpl < 3.3 behavior where silent_list was always returned for
70797095 # non-bar-type histograms. Because consistency.
70807096 res = obj [2 ]
0 commit comments