MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_quadmesh_vmin_vmax

Function test_quadmesh_vmin_vmax

lib/matplotlib/tests/test_collections.py:1096–1109  ·  view source on GitHub ↗
(pcfunc)

Source from the content-addressed store, hash-verified

1094
1095
1096def test_quadmesh_vmin_vmax(pcfunc):
1097 # test when vmin/vmax on the norm changes, the quadmesh gets updated
1098 fig, ax = plt.subplots()
1099 cmap = mpl.colormaps['plasma']
1100 norm = mpl.colors.Normalize(vmin=0, vmax=1)
1101 coll = getattr(ax, pcfunc)([[1]], cmap=cmap, norm=norm)
1102 fig.canvas.draw()
1103 assert np.array_equal(coll.get_facecolors()[0, :], cmap(norm(1)))
1104
1105 # Change the vmin/vmax of the norm so that the color is from
1106 # the bottom of the colormap now
1107 norm.vmin, norm.vmax = 1, 2
1108 fig.canvas.draw()
1109 assert np.array_equal(coll.get_facecolors()[0, :], cmap(norm(1)))
1110
1111
1112def test_quadmesh_alpha_array(pcfunc):

Callers

nothing calls this directly

Calls 3

normFunction · 0.85
subplotsMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…