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

Function test_check_button_props

lib/matplotlib/tests/test_widgets.py:1223–1242  ·  view source on GitHub ↗
(fig_test, fig_ref)

Source from the content-addressed store, hash-verified

1221
1222@check_figures_equal()
1223def test_check_button_props(fig_test, fig_ref):
1224 label_props = {'color': ['red'], 'fontsize': [24]}
1225 frame_props = {'facecolor': 'green', 'edgecolor': 'blue', 'linewidth': 2}
1226 check_props = {'facecolor': 'red', 'linewidth': 2}
1227
1228 widgets.CheckButtons(fig_ref.subplots(), ['tea', 'coffee'], [True, True],
1229 label_props=label_props, frame_props=frame_props,
1230 check_props=check_props)
1231
1232 cb = widgets.CheckButtons(fig_test.subplots(), ['tea', 'coffee'],
1233 [True, True])
1234 cb.set_label_props(label_props)
1235 # Setting the label size automatically increases default marker size, so we
1236 # need to do that here as well.
1237 cb.set_frame_props({**frame_props, 's': (24 / 2)**2})
1238 # FIXME: Axes.scatter promotes facecolor to edgecolor on unfilled markers,
1239 # but Collection.update doesn't do that (it forgot the marker already).
1240 # This means we cannot pass facecolor to both setters directly.
1241 check_props['edgecolor'] = check_props.pop('facecolor')
1242 cb.set_check_props({**check_props, 's': (24 / 2)**2})
1243
1244
1245@pytest.mark.parametrize("widget", [widgets.RadioButtons, widgets.CheckButtons])

Callers

nothing calls this directly

Calls 5

set_frame_propsMethod · 0.95
set_check_propsMethod · 0.95
set_label_propsMethod · 0.80
subplotsMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…