@@ -3363,16 +3363,17 @@ def errorbar(self, x, y, yerr=None, xerr=None,
3363
3363
if ecolor is None :
3364
3364
ecolor = base_style ['color' ]
3365
3365
3366
- # Make the style dict for the line collections (the bars), ejecting any
3367
- # marker information from format string.
3368
- eb_lines_style = dict (base_style )
3369
- eb_lines_style .pop ('marker' , None )
3370
- eb_lines_style .pop ('markersize' , None )
3371
- eb_lines_style .pop ('markerfacecolor' , None )
3372
- eb_lines_style .pop ('markeredgewidth' , None )
3373
- eb_lines_style .pop ('markeredgecolor' , None )
3374
- eb_lines_style .pop ('linestyle' , None )
3375
- eb_lines_style ['color' ] = ecolor
3366
+ # Eject any marker information from line format string, as it's not
3367
+ # needed for bars or caps.
3368
+ base_style .pop ('marker' , None )
3369
+ base_style .pop ('markersize' , None )
3370
+ base_style .pop ('markerfacecolor' , None )
3371
+ base_style .pop ('markeredgewidth' , None )
3372
+ base_style .pop ('markeredgecolor' , None )
3373
+ base_style .pop ('linestyle' , None )
3374
+
3375
+ # Make the style dict for the line collections (the bars).
3376
+ eb_lines_style = {** base_style , 'color' : ecolor }
3376
3377
3377
3378
if elinewidth :
3378
3379
eb_lines_style ['linewidth' ] = elinewidth
@@ -3383,15 +3384,8 @@ def errorbar(self, x, y, yerr=None, xerr=None,
3383
3384
if key in kwargs :
3384
3385
eb_lines_style [key ] = kwargs [key ]
3385
3386
3386
- # Make the style dict for the caps, ejecting any marker information
3387
- # from format string.
3388
- eb_cap_style = dict (base_style )
3389
- eb_cap_style .pop ('marker' , None )
3390
- eb_cap_style .pop ('markersize' , None )
3391
- eb_cap_style .pop ('markerfacecolor' , None )
3392
- eb_cap_style .pop ('markeredgewidth' , None )
3393
- eb_cap_style .pop ('markeredgecolor' , None )
3394
- eb_cap_style ['linestyle' ] = 'none'
3387
+ # Make the style dict for the caps.
3388
+ eb_cap_style = {** base_style , 'linestyle' : 'none' }
3395
3389
if capsize is None :
3396
3390
capsize = rcParams ["errorbar.capsize" ]
3397
3391
if capsize > 0 :
0 commit comments