10000 replace dict defaults with None · matplotlib/matplotlib@8cd2225 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8cd2225

Browse files
committed
replace dict defaults with None
1 parent 72b96d0 commit 8cd2225

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6870,15 +6870,15 @@ def matshow(self, Z, **kwargs):
68706870

68716871
def violinplot(self, dataset, positions=None, vert=True, widths=0.5,
68726872
showmeans=False, showextrema=True, showmedians=False,
6873-
points=100, bw_method=None, color='y', line_kw={},
6873+
points=100, bw_method=None, color='y', line_kw=None,
68746874
**fill_kw):
68756875
"""Make a violin plot.
68766876
68776877
Call signature::
68786878
68796879
violinplot(dataset, positions=None, vert=True, widths=0.5,
68806880
showmeans=False, showextrema=True, showmedians=False,
6881-
points=100, bw_method=None, color='y', line_kw={},
6881+
points=100, bw_method=None, color='y', line_kw=None,
68826882
**fill_kw):
68836883
68846884
Make a violin plot for each column of *dataset* or each vector in
@@ -6986,14 +6986,14 @@ def _kde_method(X, coords):
69866986

69876987
def violin(self, vpstats, positions=None, vert=True, widths=0.5,
69886988
showmeans=False, showextrema=True, showmedians=False,
6989-
color='y', line_kw={}, **fill_kw):
6989+
color='y', line_kw=None, **fill_kw):
69906990
"""Drawing function for violin plots.
69916991
69926992
Call signature::
69936993
69946994
violin(vpstats, positions=None, vert=True, widths=0.5,
69956995
showmeans=False, showextrema=True, showmedians=False,
6996-
color='y', line_kw={}, **fill_kw):
6996+
color='y', line_kw=None, **fill_kw):
69976997
69986998
Draw a violin plot for each column of `vpstats`. Each filled area
69996999
extends to represent the entire data range, with optional lines at the
@@ -7124,6 +7124,9 @@ def violin(self, vpstats, positions=None, vert=True, widths=0.5,
71247124
elif len(color) != N:
71257125
raise ValueError(datashape_message.format("color"))
71267126

7127+
if line_kw is None:
7128+
line_kw = {}
7129+
71277130
# original default values for line color and alpha
71287131
line_color = line_kw.pop('colors', 'r')
71297132
alpha = fill_kw.pop('alpha', 0.3)

lib/matplotlib/pyplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3420,7 +3420,7 @@ def triplot(*args, **kwargs):
34203420
@_autogen_docstring(Axes.violinplot)
34213421
def violinplot(dataset, positions=None, vert=True, widths=0.5, showmeans=False,
34223422
showextrema=True, showmedians=False, points=100, bw_method=None,
3423-
color='y', line_kw={}, hold=None, **fill_kw):
3423+
color='y', line_kw=None, hold=None, **fill_kw):
34243424
ax = gca()
34253425
# allow callers to override the hold state by passing hold=True|False
34263426
washold = ax.ishold()

0 commit comments

Comments
 (0)
0