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

Function test_nonorm

lib/matplotlib/tests/test_colorbar.py:1097–1107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1095
1096@image_comparison(['nonorm_colorbars.svg'], style='mpl20')
1097def test_nonorm():
1098 plt.rcParams['svg.fonttype'] = 'none'
1099 data = [1, 2, 3, 4, 5]
1100
1101 fig, ax = plt.subplots(figsize=(6, 1))
1102 fig.subplots_adjust(bottom=0.5)
1103
1104 norm = NoNorm(vmin=min(data), vmax=max(data))
1105 cmap = mpl.colormaps["viridis"].resampled(len(data))
1106 mappable = cm.ScalarMappable(norm=norm, cmap=cmap)
1107 cbar = fig.colorbar(mappable, cax=ax, orientation="horizontal")
1108
1109
1110@image_comparison(['test_boundaries.png'], remove_text=True,

Callers

nothing calls this directly

Calls 5

NoNormClass · 0.90
subplots_adjustMethod · 0.80
subplotsMethod · 0.45
resampledMethod · 0.45
colorbarMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…