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 2b7e399

Browse filesBrowse files
committed
Add test for polar limit changing
1 parent c8a66d4 commit 2b7e399
Copy full SHA for 2b7e399

File tree

1 file changed

+23
-0
lines changed
Filter options

1 file changed

+23
-0
lines changed

‎lib/matplotlib/tests/test_polar.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_polar.py
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,3 +427,26 @@ def test_cursor_precision():
427427
assert ax.format_coord(2, 0) == "θ=0.6π (115°), r=0.000"
428428
assert ax.format_coord(2, .1) == "θ=0.64π (115°), r=0.100"
429429
assert ax.format_coord(2, 1) == "θ=0.637π (114.6°), r=1.000"
430+
431+
@check_figures_equal(extensions=["png"])
432+
def test_polar_lim_draw(fig_test, fig_ref):
433+
"""
434+
Check that lines on polar axes are correctly transformed after
435+
a draw and an axes limit change.
436+
437+
"""
438+
# A quarter arc at r=5
439+
theta = np.linspace(0, np.pi/2, 90)
440+
r = np.full(90, 5)
441+
442+
ax_ref = fig_ref.add_subplot(projection='polar')
443+
ax_ref.set_ylim(0, 10)
444+
ax_ref.plot(theta, r)
445+
446+
ax_test = fig_test.add_subplot(projection='polar')
447+
ax_test.set_ylim(4, 10)
448+
449+
ax_test.plot(theta, r)
450+
fig_test.canvas.draw()
451+
452+
ax_test.set_ylim(0, 10)

0 commit comments

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