Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9cc32b0 commit c4b9f9fCopy full SHA for c4b9f9f
1 file changed
lib/matplotlib/tests/test_collections.py
@@ -677,6 +677,22 @@ def test_collection_set_verts_array():
677
assert np.array_equal(ap._codes, atp._codes)
678
679
680
+def test_collection_set_array():
681
+ vals = [*range(10)]
682
+
683
+ # Test set_array with list
684
+ c = Collection()
685
+ c.set_array(vals)
686
687
+ # Test set_array with wrong dtype
688
+ with pytest.raises(TypeError, match="^Image data of dtype"):
689
+ c.set_array("wrong_input")
690
691
+ # Test if array kwarg is copied
692
+ vals[5] = 45
693
+ assert np.not_equal(vals, c.get_array()).any()
694
695
696
def test_blended_collection_autolim():
697
a = [1, 2, 4]
698
height = .2
0 commit comments