MCPcopy Create free account
hub / github.com/vispy/vispy / test_histogram

Function test_histogram

vispy/visuals/tests/test_histogram.py:12–21  ·  view source on GitHub ↗

Test histogram visual

()

Source from the content-addressed store, hash-verified

10
11@requires_application()
12def test_histogram():
13 """Test histogram visual"""
14 size = (200, 100)
15 with TestingCanvas(size=size, bgcolor='w') as c:
16 np.random.seed(2397)
17 data = np.random.normal(size=100)
18 hist = Histogram(data, bins=20, color='k', parent=c.scene)
19 hist.transform = STTransform((size[0] // 10, -size[1] // 20, 1),
20 (100, size[1]))
21 assert_image_approved(c.render(), "visuals/histogram.png")
22
23
24run_tests_if_main()

Callers

nothing calls this directly

Calls 4

TestingCanvasFunction · 0.90
STTransformClass · 0.90
assert_image_approvedFunction · 0.90
renderMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…