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

Function test_fillbetween_cycle

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

Source from the content-addressed store, hash-verified

8064
8065@mpl.style.context('default')
8066def test_fillbetween_cycle():
8067 fig, ax = plt.subplots()
8068
8069 for j in range(3):
8070 cc = ax.fill_between(range(3), range(3))
8071 target = mcolors.to_rgba(f'C{j}')
8072 assert tuple(cc.get_facecolors().squeeze()) == tuple(target)
8073
8074 for j in range(3, 6):
8075 cc = ax.fill_betweenx(range(3), range(3))
8076 target = mcolors.to_rgba(f'C{j}')
8077 assert tuple(cc.get_facecolors().squeeze()) == tuple(target)
8078
8079 target = mcolors.to_rgba('k')
8080
8081 for al in ['facecolor', 'facecolors', 'color']:
8082 cc = ax.fill_between(range(3), range(3), **{al: 'k'})
8083 assert tuple(cc.get_facecolors().squeeze()) == tuple(target)
8084
8085 edge_target = mcolors.to_rgba('k')
8086 for j, el in enumerate(['edgecolor', 'edgecolors'], start=6):
8087 cc = ax.fill_between(range(3), range(3), **{el: 'k'})
8088 face_target = mcolors.to_rgba(f'C{j}')
8089 assert tuple(cc.get_facecolors().squeeze()) == tuple(face_target)
8090 assert tuple(cc.get_edgecolors().squeeze()) == tuple(edge_target)
8091
8092
8093def test_log_margins():

Callers

nothing calls this directly

Calls 4

fill_betweenxMethod · 0.80
subplotsMethod · 0.45
fill_betweenMethod · 0.45
to_rgbaMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…