10000 Add test · matplotlib/matplotlib@19476de · GitHub
[go: up one dir, main page]

Skip to content

Commit 19476de

Browse files
committed
Add test
1 parent d1acaf2 commit 19476de

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
Loading

lib/matplotlib/tests/test_collections.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,22 @@ def test_polycollection_close():
513513
ax.set_ylim3d(0, 4)
514514

515515

516+
@image_comparison(baseline_images=['regularpolycollection_rotate'],
517+
extensions=['png'], remove_text=True)
518+
def test_regularpolycollection_rotate():
519+
xx, yy = np.mgrid[:10, :10]
520+
xy_points = np.transpose([xx.flatten(), yy.flatten()])
521+
rotations = np.linspace(0, 2*np.pi, len(xy_points))
522+
523+
fig, ax = plt.subplots()
524+
for xy, alpha in zip(xy_points, rotations):
525+
col = mcollections.RegularPolyCollection(
526+
4, sizes=(100,), rotation=alpha,
527+
offsets=xy, transOffset=ax.transData)
528+
ax.add_collection(col, autolim=True)
529+
ax.autoscale_view()
530+
531+
516532
if __name__ == '__main__':
517533
import nose
518534
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)

0 commit comments

Comments
 (0)
0