Skip to content

Commit 030dbef

Browse files
committed
Merge remote-tracking branch 'matplotlib/v2.x'
2 parents 597d2ef + 042ee89 commit 030dbef

File tree

5 files changed

+80
-64
lines changed

5 files changed

+80
-64
lines changed

lib/matplotlib/axes/_axes.py

+13-18
Original file line numberDiff line numberDiff line change
@@ -6304,24 +6304,19 @@ def _normalize_input(inp, ename='input'):
63046304
xvals.append(x.copy())
63056305
yvals.append(y.copy())
63066306

6307-
if fill:
6308-
# add patches in reverse order so that when stacking,
6309-
# items lower in the stack are plottted on top of
6310-
# items higher in the stack
6311-
for x, y, c in reversed(list(zip(xvals, yvals, color))):
6312-
patches.append(self.fill(
6313-
x, y,
6314-
closed=True,
6315-
facecolor=c,
6316-
margins=margins))
6317-
else:
6318-
for x, y, c in reversed(list(zip(xvals, yvals, color))):
6319-
split = 2 * len(bins)
6320-
patches.append(self.fill(
6321-
x[:split], y[:split],
6322-
closed=False, edgecolor=c,
6323-
fill=False,
6324-
margins=margins))
6307+
#stepfill is closed, step is not
6308+
split = -1 if fill else 2 * len(bins)
6309+
# add patches in reverse order so that when stacking,
6310+
# items lower in the stack are plottted on top of
6311+
# items higher in the stack
6312+
for x, y, c in reversed(list(zip(xvals, yvals, color))):
6313+
patches.append(self.fill(
6314+
x[:split], y[:split],
6315+
closed=True if fill else None,
6316+
facecolor=c,
6317+
edgecolor=None if fill else c,
6318+
fill=fill if fill else None,
6319+
margins=margins))
63256320

63266321
# we return patches, so put it back in the expected order
63276322
patches.reverse()

lib/matplotlib/rcsetup.py

+21-21
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ def validate_animation_writer_path(p):
975975
'font.variant': ['normal', six.text_type],
976976
'font.stretch': ['normal', six.text_type],
977977
'font.weight': ['normal', six.text_type],
978-
'font.size': [12, validate_float], # Base font size in points
978+
'font.size': [10, validate_float], # Base font size in points
979979
'font.serif': [['DejaVu Serif', 'Bitstream Vera Serif',
980980
'New Century Schoolbook', 'Century Schoolbook L',
981981
'Utopia', 'ITC Bookman', 'Bookman',
@@ -1041,7 +1041,7 @@ def validate_animation_writer_path(p):
10411041
'axes.hold': [True, validate_bool],
10421042
'axes.facecolor': ['w', validate_color], # background color; white
10431043
'axes.edgecolor': ['k', validate_color], # edge color; black
1044-
'axes.linewidth': [1.0, validate_float], # edge linewidth
1044+
'axes.linewidth': [0.8, validate_float], # edge linewidth
10451045

10461046
'axes.spines.left': [True, validate_bool], # Set visibility of axes
10471047
'axes.spines.right': [True, validate_bool], # 'spines', the lines
@@ -1051,7 +1051,7 @@ def validate_animation_writer_path(p):
10511051
'axes.titlesize': ['large', validate_fontsize], # fontsize of the
10521052
# axes title
10531053
'axes.titleweight': ['normal', six.text_type], # font weight of axes title
1054-
'axes.titlepad': [9.0, validate_float], # pad from axes top to title in points
1054+
'axes.titlepad': [4.0, validate_float], # pad from axes top to title in points
10551055
'axes.grid': [False, validate_bool], # display grid or not
10561056
'axes.grid.which': ['major', validate_axis_locator], # set wether the gid are by
10571057
# default draw on 'major'
@@ -1061,7 +1061,7 @@ def validate_animation_writer_path(p):
10611061
# Can be 'x', 'y', 'both'
10621062
'axes.labelsize': ['medium', validate_fontsize], # fontsize of the
10631063
# x any y labels
1064-
'axes.labelpad': [5.0, validate_float], # space between label and axis
1064+
'axes.labelpad': [4.0, validate_float], # space between label and axis
10651065
'axes.labelweight': ['normal', six.text_type], # fontsize of the x any y labels
10661066
'axes.labelcolor': ['k', validate_color], # color of axis label
10671067
'axes.formatter.limits': [[-7, 7], validate_nseq_int(2)],
@@ -1153,14 +1153,14 @@ def validate_animation_writer_path(p):
11531153
'legend.edgecolor': ['none', validate_color_or_inherit],
11541154

11551155
# tick properties
1156-
'xtick.top': [True, validate_bool], # draw ticks on the top side
1156+
'xtick.top': [False, validate_bool], # draw ticks on the top side
11571157
'xtick.bottom': [True, validate_bool], # draw ticks on the bottom side
1158-
'xtick.major.size': [4, validate_float], # major xtick size in points
1158+
'xtick.major.size': [3.5, validate_float], # major xtick size in points
11591159
'xtick.minor.size': [2, validate_float], # minor xtick size in points
1160-
'xtick.major.width': [1.0, validate_float], # major xtick width in points
1161-
'xtick.minor.width': [1.0, validate_float], # minor xtick width in points
1162-
'xtick.major.pad': [4, validate_float], # distance to label in points
1163-
'xtick.minor.pad': [4, validate_float], # distance to label in points
1160+
'xtick.major.width': [0.8, validate_float], # major xtick width in points
1161+
'xtick.minor.width': [0.6, validate_float], # minor xtick width in points
1162+
'xtick.major.pad': [3.5, validate_float], # distance to label in points
1163+
'xtick.minor.pad': [3.4, validate_float], # distance to label in points
11641164
'xtick.color': ['k', validate_color], # color of the xtick labels
11651165
'xtick.minor.visible': [False, validate_bool], # visiablility of the x axis minor ticks
11661166

@@ -1169,13 +1169,13 @@ def validate_animation_writer_path(p):
11691169
'xtick.direction': ['out', six.text_type], # direction of xticks
11701170

11711171
'ytick.left': [True, validate_bool], # draw ticks on the left side
1172-
'ytick.right': [True, validate_bool], # draw ticks on the right side
1173-
'ytick.major.size': [4, validate_float], # major ytick size in points
1172+
'ytick.right': [False, validate_bool], # draw ticks on the right side
1173+
'ytick.major.size': [3.5, validate_float], # major ytick size in points
11741174
'ytick.minor.size': [2, validate_float], # minor ytick size in points
1175-
'ytick.major.width': [1.0, validate_float], # major ytick width in points
1176-
'ytick.minor.width': [1.0, validate_float], # minor ytick width in points
1177-
'ytick.major.pad': [4, validate_float], # distance to label in points
1178-
'ytick.minor.pad': [4, validate_float], # distance to label in points
1175+
'ytick.major.width': [0.8, validate_float], # major ytick width in points
1176+
'ytick.minor.width': [0.6, validate_float], # minor ytick width in points
1177+
'ytick.major.pad': [3.5, validate_float], # distance to label in points
1178+
'ytick.minor.pad': [3.4, validate_float], # distance to label in points
11791179
'ytick.color': ['k', validate_color], # color of the ytick labels
11801180
'ytick.minor.visible': [False, validate_bool], # visiablility of the y axis minor ticks
11811181

@@ -1185,7 +1185,7 @@ def validate_animation_writer_path(p):
11851185

11861186
'grid.color': ['#b0b0b0', validate_color], # grid color
11871187
'grid.linestyle': ['-', six.text_type], # solid
1188-
'grid.linewidth': [1.0, validate_float], # in points
1188+
'grid.linewidth': [0.8, validate_float], # in points
11891189
'grid.alpha': [1.0, validate_float],
11901190

11911191

@@ -1203,13 +1203,13 @@ def validate_animation_writer_path(p):
12031203
'figure.autolayout': [False, validate_bool],
12041204
'figure.max_open_warning': [20, validate_int],
12051205

1206-
'figure.subplot.left': [0.155, ValidateInterval(0, 1, closedmin=True,
1206+
'figure.subplot.left': [0.125, ValidateInterval(0, 1, closedmin=True,
12071207
closedmax=True)],
1208-
'figure.subplot.right': [0.87, ValidateInterval(0, 1, closedmin=True,
1208+
'figure.subplot.right': [0.9, ValidateInterval(0, 1, closedmin=True,
12091209
closedmax=True)],
1210-
'figure.subplot.bottom': [0.13, ValidateInterval(0, 1, closedmin=True,
1210+
'figure.subplot.bottom': [0.11, ValidateInterval(0, 1, closedmin=True,
12111211
closedmax=True)],
1212-
'figure.subplot.top': [0.87, ValidateInterval(0, 1, closedmin=True,
1212+
'figure.subplot.top': [0.88, ValidateInterval(0, 1, closedmin=True,
12131213
closedmax=True)],
12141214
'figure.subplot.wspace': [0.2, ValidateInterval(0, 1, closedmin=True,
12151215
closedmax=False)],

lib/matplotlib/tests/test_axes.py

+23-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import matplotlib.markers as mmarkers
2828
import matplotlib.patches as mpatches
2929
from numpy.testing import assert_allclose, assert_array_equal
30-
import warnings
3130
from matplotlib.cbook import IgnoredKeywordWarning
3231
import matplotlib.colors as mcolors
3332

@@ -36,6 +35,7 @@
3635
# different baseline images to prevent race conditions when nose runs
3736
# the tests with multiple threads.
3837

38+
3939
@image_comparison(baseline_images=['formatter_ticker_001',
4040
'formatter_ticker_002',
4141
'formatter_ticker_003',
@@ -1151,6 +1151,27 @@ def test_hist_steplog():
11511151
plt.hist(data_big, 100, histtype='stepfilled', log=True, orientation='horizontal')
11521152

11531153

1154+
@image_comparison(baseline_images=['hist_step_filled'], remove_text=True,
1155+
extensions=['png'])
1156+
def test_hist_step_filled():
1157+
np.random.seed(0)
1158+
x = np.random.randn(1000, 3)
1159+
n_bins = 10
1160+
1161+
kwargs = [{'fill': True}, {'fill': False}, {'fill': None}, {}]*2
1162+
types = ['step']*4+['stepfilled']*4
1163+
fig, axes = plt.subplots(nrows=2, ncols=4)
1164+
axes = axes.flatten()
1165+
1166+
for kg, _type, ax in zip(kwargs, types, axes):
1167+
ax.hist(x, n_bins, histtype=_type, stacked=True, **kg)
1168+
ax.set_title('%s/%s' % (kg, _type))
1169+
ax.set_ylim(ymin=-50)
1170+
1171+
patches = axes[0].patches
1172+
assert all([p.get_facecolor() == p.get_edgecolor() for p in patches])
1173+
1174+
11541175
@image_comparison(baseline_images=['hist_step_log_bottom'],
11551176
remove_text=True, extensions=['png'])
11561177
def test_hist_step_log_bottom():
@@ -1765,7 +1786,7 @@ def test_boxplot():
17651786
ax.set_ylim((-30, 30))
17661787

17671788
# Reuse testcase from above for a labeled data test
1768-
data={"x": [x, x]}
1789+
data = {"x": [x, x]}
17691790
fig, ax = plt.subplots()
17701791
ax.boxplot("x", bootstrap=10000, notch=1, data=data)
17711792
ax.set_ylim((-30, 30))

matplotlibrc.template

+23-23
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ backend : $TEMPLATE_BACKEND
190190
# property is not currently implemented.
191191
#
192192
# The font.size property is the default font size for text, given in pts.
193-
# 12pt is the standard value.
193+
# 10 pt is the standard value.
194194
#
195195
#font.family : sans-serif
196196
#font.style : normal
@@ -202,7 +202,7 @@ backend : $TEMPLATE_BACKEND
202202
# settings for axes and ticks. Special text sizes can be defined
203203
# relative to font.size, using the following values: xx-small, x-small,
204204
# small, medium, large, x-large, xx-large, larger, or smaller
205-
#font.size : 12.0
205+
#font.size : 10.0
206206
#font.serif : DejaVu Serif, Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
207207
#font.sans-serif : DejaVu Sans, Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
208208
#font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, Script MT, Felipa, cursive
@@ -294,12 +294,12 @@ backend : $TEMPLATE_BACKEND
294294
#axes.hold : True # whether to clear the axes by default on
295295
#axes.facecolor : white # axes background color
296296
#axes.edgecolor : black # axes edge color
297-
#axes.linewidth : 1.0 # edge linewidth
297+
#axes.linewidth : 0.8 # edge linewidth
298298
#axes.grid : False # display grid or not
299299
#axes.titlesize : large # fontsize of the axes title
300-
#axes.titlepad : 9.0 # pad between axes and title in points
300+
#axes.titlepad : 4.0 # pad between axes and title in points
301301
#axes.labelsize : medium # fontsize of the x any y labels
302-
#axes.labelpad : 5.0 # space between label and axis
302+
#axes.labelpad : 4.0 # space between label and axis
303303
#axes.labelweight : normal # weight of the x and y labels
304304
#axes.labelcolor : black
305305
#axes.axisbelow : 'line' # draw axis gridlines and ticks below
@@ -361,27 +361,27 @@ backend : $TEMPLATE_BACKEND
361361

362362
### TICKS
363363
# see http://matplotlib.org/api/axis_api.html#matplotlib.axis.Tick
364-
#xtick.top : True # draw ticks on the top side
364+
#xtick.top : False # draw ticks on the top side
365365
#xtick.bottom : True # draw ticks on the bottom side
366-
#xtick.major.size : 4 # major tick size in points
366+
#xtick.major.size : 3.5 # major tick size in points
367367
#xtick.minor.size : 2 # minor tick size in points
368-
#xtick.major.width : 1.0 # major tick width in points
369-
#xtick.minor.width : 1.0 # minor tick width in points
370-
#xtick.major.pad : 4 # distance to major tick label in points
371-
#xtick.minor.pad : 4 # distance to the minor tick label in points
368+
#xtick.major.width : 0.8 # major tick width in points
369+
#xtick.minor.width : 0.6 # minor tick width in points
370+
#xtick.major.pad : 3.5 # distance to major tick label in points
371+
#xtick.minor.pad : 3.4 # distance to the minor tick label in points
372372
#xtick.color : k # color of the tick labels
373373
#xtick.labelsize : medium # fontsize of the tick labels
374374
#xtick.direction : out # direction: in, out, or inout
375375
#xtick.minor.visible : False # visibility of minor ticks on x-axis
376376

377377
#ytick.left : True # draw ticks on the left side
378-
#ytick.right : True # draw ticks on the right side
379-
#ytick.major.size : 4 # major tick size in points
378+
#ytick.right : False # draw ticks on the right side
379+
#ytick.major.size : 3.5 # major tick size in points
380380
#ytick.minor.size : 2 # minor tick size in points
381-
#ytick.major.width : 1.0 # major tick width in points
382-
#ytick.minor.width : 1.0 # minor tick width in points
383-
#ytick.major.pad : 4 # distance to major tick label in points
384-
#ytick.minor.pad : 4 # distance to the minor tick label in points
381+
#ytick.major.width : 0.8 # major tick width in points
382+
#ytick.minor.width : 0.6 # minor tick width in points
383+
#ytick.major.pad : 3.5 # distance to major tick label in points
384+
#ytick.minor.pad : 3.4 # distance to the minor tick label in points
385385
#ytick.color : k # color of the tick labels
386386
#ytick.labelsize : medium # fontsize of the tick labels
387387
#ytick.direction : out # direction: in, out, or inout
@@ -391,7 +391,7 @@ backend : $TEMPLATE_BACKEND
391391
### GRIDS
392392
#grid.color : b0b0b0 # grid color
393393
#grid.linestyle : - # solid
394-
#grid.linewidth : 1.0 # in points
394+
#grid.linewidth : 0.8 # in points
395395
#grid.alpha : 1.0 # transparency, between 0.0 and 1.0
396396

397397
### Legend
@@ -431,14 +431,14 @@ backend : $TEMPLATE_BACKEND
431431
# If less than one this feature is disabled.
432432

433433
# The figure subplot parameters. All dimensions are a fraction of the
434-
# figure width or height
435-
#figure.subplot.left : 0.155 # the left side of the subplots of the figure
436-
#figure.subplot.right : 0.87 # the right side of the subplots of the figure
437-
#figure.subplot.bottom : 0.13 # the bottom of the subplots of the figure
438-
#figure.subplot.top : 0.87 # the top of the subplots of the figure
434+
#figure.subplot.left : 0.125 # the left side of the subplots of the figure
435+
#figure.subplot.right : 0.9 # the right side of the subplots of the figure
436+
#figure.subplot.bottom : 0.11 # the bottom of the subplots of the figure
437+
#figure.subplot.top : 0.88 # the top of the subplots of the figure
439438
#figure.subplot.wspace : 0.2 # the amount of width reserved for blank space between subplots
440439
#figure.subplot.hspace : 0.2 # the amount of height reserved for white space between subplots
441440

441+
442442
### IMAGES
443443
#image.aspect : equal # equal | auto | a number
444444
#image.interpolation : nearest # see help(imshow) for options

0 commit comments

Comments
 (0)