Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8eea274

Browse files
committed
Re-group errorbar styling dictionaries.
The lines and caps dictionary modifications are intermixed, making them a bit confusing. Also do the same marker style removal from the cap style, which would normally be replaced later.
1 parent 1c59fb0 commit 8eea274

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3314,9 +3314,15 @@ def errorbar(self, x, y, yerr=None, xerr=None,
33143314
kwargs['zorder'] + .1),
33153315
}
33163316

3317-
# make the style dict for the line collections (the bars)
3317+
# Make the style dict for the line collections (the bars), ejecting any
3318+
# marker information from format string.
33183319
eb_lines_style = dict(base_style)
33193320
eb_lines_style.pop('marker', None)
3321+
eb_lines_style.pop('markersize', None)
3322+
eb_lines_style.pop('markerfacecolor', None)
3323+
eb_lines_style.pop('markeredgewidth', None)
3324+
eb_lines_style.pop('markeredgecolor', None)
3325+
eb_lines_style.pop('ls', None)
33203326
eb_lines_style.pop('linestyle', None)
33213327
eb_lines_style['color'] = ecolor
33223328

@@ -3329,13 +3335,14 @@ def errorbar(self, x, y, yerr=None, xerr=None,
33293335
if key in kwargs:
33303336
eb_lines_style[key] = kwargs[key]
33313337

3332-
# set up cap style dictionary
3338+
# Make the style dict for the caps, ejecting any marker information
3339+
# from format string.
33333340
eb_cap_style = dict(base_style)
3334-
# eject any marker information from format string
33353341
eb_cap_style.pop('marker', None)
3336-
eb_lines_style.pop('markerfacecolor', None)
3337-
eb_lines_style.pop('markeredgewidth', None)
3338-
eb_lines_style.pop('markeredgecolor', None)
3342+
eb_cap_style.pop('markersize', None)
3343+
eb_cap_style.pop('markerfacecolor', None)
3344+
eb_cap_style.pop('markeredgewidth', None)
3345+
eb_cap_style.pop('markeredgecolor', None)
33393346
eb_cap_style.pop('ls', None)
33403347
eb_cap_style['linestyle'] = 'none'
33413348
if capsize is None:

0 commit comments

Comments
 (0)