Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8428821

Browse filesBrowse files
committed
Merge pull request #5995 from QuLogic/more-default-colours
Apply new default colours in more places
2 parents d063820 + 76756ac commit 8428821
Copy full SHA for 8428821

File tree

Expand file treeCollapse file tree

2 files changed

+51
-14
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+51
-14
lines changed

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+50-13Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2416,34 +2416,71 @@ def stem(self, *args, **kwargs):
24162416

24172417
# Popping some defaults
24182418
try:
2419-
linefmt = kwargs.pop('linefmt', args[0])
2420-
except IndexError:
2421-
linefmt = kwargs.pop('linefmt', 'b-')
2419+
linefmt = kwargs['linefmt']
2420+
except KeyError:
2421+
try:
2422+
linefmt = args[0]
2423+
except IndexError:
2424+
linecolor = 'C0'
2425+
linemarker = 'None'
2426+
linestyle = '-'
2427+
else:
2428+
linestyle, linemarker, linecolor = \
2429+
_process_plot_format(linefmt)
2430+
else:
2431+
linestyle, linemarker, linecolor = _process_plot_format(linefmt)
24222432
try:
2423-
markerfmt = kwargs.pop('markerfmt', args[1])
2424-
except IndexError:
2425-
markerfmt = kwargs.pop('markerfmt', 'bo')
2433+
markerfmt = kwargs['markerfmt']
2434+
except KeyError:
2435+
try:
2436+
markerfmt = args[1]
2437+
except IndexError:
2438+
markercolor = 'C0'
2439+
markermarker = 'o'
2440+
markerstyle = 'None'
2441+
else:
2442+
markerstyle, markermarker, markercolor = \
2443+
_process_plot_format(markerfmt)
2444+
else:
2445+
markerstyle, markermarker, markercolor = \
2446+
_process_plot_format(markerfmt)
24262447
try:
2427-
basefmt = kwargs.pop('basefmt', args[2])
2428-
except IndexError:
2429-
basefmt = kwargs.pop('basefmt', 'r-')
2448+
basefmt = kwargs['basefmt']
2449+
except KeyError:
2450+
try:
2451+
basefmt = args[2]
2452+
except IndexError:
2453+
if rcParams['_internal.classic_mode']:
2454+
basecolor = 'C2'
2455+
else:
2456+
basecolor = 'C3'
2457+
basemarker = 'None'
2458+
basestyle = '-'
2459+
else:
2460+
basestyle, basemarker, basecolor = \
2461+
_process_plot_format(basefmt)
2462+
else:
2463+
basestyle, basemarker, basecolor = _process_plot_format(basefmt)
24302464

24312465
bottom = kwargs.pop('bottom', None)
24322466
label = kwargs.pop('label', None)
24332467

2434-
markerline, = self.plot(x, y, markerfmt, label="_nolegend_")
2468+
markerline, = self.plot(x, y, color=markercolor, linestyle=markerstyle,
2469+
marker=markermarker, label="_nolegend_")
24352470

24362471
if bottom is None:
24372472
bottom = 0
24382473

24392474
stemlines = []
24402475
for thisx, thisy in zip(x, y):
2441-
l, = self.plot([thisx, thisx], [bottom, thisy], linefmt,
2442-
label="_nolegend_")
2476+
l, = self.plot([thisx, thisx], [bottom, thisy],
2477+
color=linecolor, linestyle=linestyle,
2478+
marker=linemarker, label="_nolegend_")
24432479
stemlines.append(l)
24442480

24452481
baseline, = self.plot([np.amin(x), np.amax(x)], [bottom, bottom],
2446-
basefmt, label="_nolegend_")
2482+
color=basecolor, linestyle=basestyle,
2483+
marker=basemarker, label="_nolegend_")
24472484

24482485
self.hold(remember_hold)
24492486

‎lib/matplotlib/rcsetup.py

Copy file name to clipboardExpand all lines: lib/matplotlib/rcsetup.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ def validate_hist_bins(s):
950950
'boxplot.medianprops.linewidth': [1.0, validate_float],
951951
'boxplot.medianprops.linestyle': ['-', six.text_type],
952952

953-
'boxplot.meanprops.color': ['r', validate_color],
953+
'boxplot.meanprops.color': ['C3', validate_color],
954954
'boxplot.meanprops.linewidth': [1.0, validate_float],
955955
'boxplot.meanprops.linestyle': ['-', six.text_type],
956956

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.