()
| 1064 | |
| 1065 | |
| 1066 | def test_quadmesh_set_array(): |
| 1067 | x = np.arange(4) |
| 1068 | y = np.arange(4) |
| 1069 | z = np.arange(9).reshape((3, 3)) |
| 1070 | fig, ax = plt.subplots() |
| 1071 | coll = ax.pcolormesh(x, y, np.ones(z.shape)) |
| 1072 | # Test that the collection is able to update with a 2d array |
| 1073 | coll.set_array(z) |
| 1074 | fig.canvas.draw() |
| 1075 | assert np.array_equal(coll.get_array(), z) |
| 1076 | |
| 1077 | # Check that pre-flattened arrays work too |
| 1078 | coll.set_array(np.ones(9)) |
| 1079 | fig.canvas.draw() |
| 1080 | assert np.array_equal(coll.get_array(), np.ones(9)) |
| 1081 | |
| 1082 | z = np.arange(16).reshape((4, 4)) |
| 1083 | fig, ax = plt.subplots() |
| 1084 | coll = ax.pcolormesh(x, y, np.ones(z.shape), shading='gouraud') |
| 1085 | # Test that the collection is able to update with a 2d array |
| 1086 | coll.set_array(z) |
| 1087 | fig.canvas.draw() |
| 1088 | assert np.array_equal(coll.get_array(), z) |
| 1089 | |
| 1090 | # Check that pre-flattened arrays work too |
| 1091 | coll.set_array(np.ones(16)) |
| 1092 | fig.canvas.draw() |
| 1093 | assert np.array_equal(coll.get_array(), np.ones(16)) |
| 1094 | |
| 1095 | |
| 1096 | def test_quadmesh_vmin_vmax(pcfunc): |
nothing calls this directly
no test coverage detected
searching dependent graphs…