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

Function test_hist_float16

lib/matplotlib/tests/test_axes.py:2516–2528  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2514
2515
2516def test_hist_float16():
2517 np.random.seed(19680801)
2518 values = np.clip(
2519 np.random.normal(0.5, 0.3, size=1000), 0, 1).astype(np.float16)
2520 h = plt.hist(values, bins=3, alpha=0.5)
2521 bc = h[2]
2522 # Check that there are no overlapping rectangles
2523 for r in range(1, len(bc)):
2524 rleft = bc[r-1].get_corners()
2525 rright = bc[r].get_corners()
2526 # right hand position of left rectangle <=
2527 # left hand position of right rectangle
2528 assert rleft[1][0] <= rright[0][0]
2529
2530
2531@image_comparison(['hist_step_empty.png'], remove_text=True, style='_classic_test')

Callers

nothing calls this directly

Calls 3

histMethod · 0.80
clipMethod · 0.45
get_cornersMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…