Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commite7dd0e3

Browse files
committed
Adapt drawstyles test.
Remove duplicated test as well.
1 parent13b4555 commite7dd0e3

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

‎lib/matplotlib/tests/test_axes.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4460,12 +4460,6 @@ def test_ls_ds_conflict():
44604460
linestyle='steps-pre:',drawstyle='steps-post')
44614461

44624462

4463-
@cleanup
4464-
deftest_ls_ds_conflict():
4465-
assert_raises(ValueError,plt.plot,range(32),
4466-
linestyle='steps-pre:',drawstyle='steps-post')
4467-
4468-
44694463
@image_comparison(baseline_images=['date_timezone_x'],extensions=['png'])
44704464
deftest_date_timezone_x():
44714465
# Tests issue 5575

‎lib/matplotlib/tests/test_lines.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,18 @@ def test_valid_linestyles():
118118
line.set_linestyle('aardvark')
119119

120120

121-
@cleanup
121+
@image_comparison(baseline_images=['drawstyle_variants'],remove_text=True,
122+
extensions=["png"])
122123
deftest_drawstyle_variants():
123-
fig=plt.figure()
124-
ax=fig.add_subplot(1,1,1)
125-
fordsin ("default","steps-mid","steps-pre","steps-post",
126-
"steps",None):
127-
ax.plot(range(10),drawstyle=ds)
128-
129-
fig.canvas.draw()
130-
assertTrue
124+
fig,axs=plt.subplots(6)
125+
dss= ["default","steps-mid","steps-pre","steps-post","steps",None]
126+
# We want to check that drawstyles are properly handled even for very long
127+
# lines (for which the subslice optimization is on); however, we need
128+
# to zoom in so that the difference between the drawstyles is actually
129+
# visible.
130+
forax,dsinzip(axs.flat,dss):
131+
ax.plot(range(2000),drawstyle=ds)
132+
ax.set(xlim=(0,2),ylim=(0,2))
131133

132134

133135
@cleanup

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp