diff --git a/doc/users/whats_new/rcparams.rst b/doc/users/whats_new/rcparams.rst index fc58c7b38016..a19cb4c3a54a 100644 --- a/doc/users/whats_new/rcparams.rst +++ b/doc/users/whats_new/rcparams.rst @@ -16,6 +16,8 @@ Configuration (rcParams) +----------------------------+--------------------------------------------------+ |`date.autoformatter.second` | format string for 'second' scale times | +----------------------------+--------------------------------------------------+ +|`scatter.marker` | default marker for scatter plot | ++----------------------------+--------------------------------------------------+ |`svg.hashsalt` | see note | +----------------------------+--------------------------------------------------+ diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 3ea8f26dcd61..790f41ceb4f3 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -3726,7 +3726,7 @@ def dopatch(xs, ys, **kwargs): 'facecolors', 'color'], label_namer="y") @docstring.dedent_interpd - def scatter(self, x, y, s=None, c=None, marker='o', cmap=None, norm=None, + def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None, vmin=None, vmax=None, alpha=None, linewidths=None, verts=None, edgecolors=None, **kwargs): @@ -3895,6 +3895,10 @@ def scatter(self, x, y, s=None, c=None, marker='o', cmap=None, norm=None, scales = s # Renamed for readability below. + # load default marker from rcParams + if marker is None: + marker = rcParams['scatter.marker'] + # to be API compatible if marker is None and not (verts is None): marker = (verts, 0) diff --git a/lib/matplotlib/mpl-data/stylelib/classic.mplstyle b/lib/matplotlib/mpl-data/stylelib/classic.mplstyle index 2ba86163b8cb..800cda75f5de 100644 --- a/lib/matplotlib/mpl-data/stylelib/classic.mplstyle +++ b/lib/matplotlib/mpl-data/stylelib/classic.mplstyle @@ -325,6 +325,9 @@ contour.corner_mask : True # errorbar props errorbar.capsize: 3 +# scatter props +scatter.marker: o + ### Boxplots boxplot.bootstrap: None boxplot.boxprops.color: b diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 9b3dd9ea81b5..c195804daadf 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -3138,7 +3138,7 @@ def quiverkey(*args, **kw): # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost @_autogen_docstring(Axes.scatter) -def scatter(x, y, s=None, c=None, marker='o', cmap=None, norm=None, vmin=None, +def scatter(x, y, s=None, c=None, marker=None, cmap=None, norm=None, vmin=None, vmax=None, alpha=None, linewidths=None, verts=None, edgecolors=None, hold=None, data=None, **kwargs): ax = gca() diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index e33a015a66d1..5bc8c2b9d909 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -1065,6 +1065,10 @@ def validate_animation_writer_path(p): 'polaraxes.grid': [True, validate_bool], # display polar grid or # not 'axes3d.grid': [True, validate_bool], # display 3d grid + + # scatter props + 'scatter.marker': ['o', six.text_type], + # TODO validate that these are valid datetime format strings 'date.autoformatter.year': ['%Y', six.text_type], 'date.autoformatter.month': ['%Y-%m', six.text_type], diff --git a/matplotlibrc.template b/matplotlibrc.template index f7aa486f0914..8463a4f26055 100644 --- a/matplotlibrc.template +++ b/matplotlibrc.template @@ -461,6 +461,9 @@ backend : $TEMPLATE_BACKEND # If Numpy 1.11 or later is # installed, may also be `auto` +### SCATTER PLOTS +#scatter.marker : o # The default marker type for scatter plots. + ### Agg rendering ### Warning: experimental, 2008/10/10 #agg.path.chunksize : 0 # 0 to disable; values in the range