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

Skip to content

Commit f40547d

Browse files
committed
Fixed test?
1 parent a55f7e7 commit f40547d

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

galleries/examples/statistics/histogram_multihist.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,8 @@
6666

6767
edgecolors = ['green', 'red', 'blue']
6868

69-
ax.hist(
70-
x, n_bins, fill=False, histtype="step", stacked=True,
71-
edgecolor=edgecolors, label=edgecolors
72-
)
69+
ax.hist(x, n_bins, fill=False, histtype="step", stacked=True,
70+
edgecolor=edgecolors, label=edgecolors)
7371
ax.legend()
7472
ax.set_title('Stacked Steps with Edgecolors')
7573

@@ -112,10 +110,8 @@
112110
linewidths = [1, 2, 3]
113111
edgecolors = ["green", "red", "blue"]
114112

115-
ax.hist(
116-
x, n_bins, fill=False, histtype="bar", linewidth=linewidths,
117-
edgecolor=edgecolors, label=linewidths,
118-
)
113+
ax.hist(x, n_bins, fill=False, histtype="bar", linewidth=linewidths,
114+
edgecolor=edgecolors, label=linewidths)
119115
ax.legend()
120116
ax.set_title("Bars with Linewidths")
121117

@@ -129,10 +125,8 @@
129125

130126
linestyles = ['-', ':', '--']
131127

132-
ax.hist(
133-
x, n_bins, fill=False, histtype='bar', linestyle=linestyles,
134-
edgecolor=edgecolors, label=linestyles
135-
)
128+
ax.hist(x, n_bins, fill=False, histtype='bar', linestyle=linestyles,
129+
edgecolor=edgecolors, label=linestyles)
136130
ax.legend()
137131
ax.set_title('Bars with Linestyles')
138132

lib/matplotlib/tests/test_axes.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4605,11 +4605,11 @@ def test_hist_stacked_bar():
46054605

46064606
@pytest.mark.parametrize('histtype, fill', [('bar', False), ('bar', True),
46074607
('step', False), ('step', True)])
4608-
@image_comparison(['hist_vectorized_params1', 'hist_vectorized_params2',
4609-
'hist_vectorized_params3', 'hist_vectorized_params4'],
4610-
extensions=["png"], remove_text=True)
4608+
@image_comparison(['hist_vectorized_params'], extensions=["png"], remove_text=True)
46114609
def test_hist_vectorized_params(histtype, fill):
4612-
fig, ((ax1, ax2, ax3), (ax4, ax5)) = plt.subplots(2, 3)
4610+
fig, axs = plt.subplots(2, 3, figsize=(8, 6))
4611+
fig.delaxes(axs[1, 1])
4612+
ax1, ax2, ax3, ax4, _, ax6 = axs.flatten()
46134613

46144614
np.random.seed(19680801)
46154615
x = [np.random.randn(n) for n in [2000, 5000, 10000]]
@@ -4625,7 +4625,7 @@ def test_hist_vectorized_params(histtype, fill):
46254625
# Only linewidth
46264626
ax4.hist(x, bins=10, histtype=histtype, fill=fill, linewidth=[1, 1.5, 2])
46274627
# Only hatch
4628-
ax5.hist(x, bins=10, histtype=histtype, fill=fill, hatch=["/", "\\", "."])
4628+
ax6.hist(x, bins=10, histtype=histtype, fill=fill, hatch=["/", "\\", "."])
46294629

46304630

46314631
def test_hist_barstacked_bottom_unchanged():

0 commit comments

Comments
 (0)