MCPcopy Index your code
hub / github.com/plotly/plotly.py / test_h_and_v_bars

Function test_h_and_v_bars

tests/test_optional/test_matplotlylib/test_bars.py:60–89  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58
59@pytest.mark.skip
60def test_h_and_v_bars():
61 fig, ax = plt.subplots()
62 ax.bar(
63 left=D["multi_left"],
64 height=D["multi_height"],
65 width=10,
66 color="green",
67 alpha=0.5,
68 )
69 # changing height 10 -> 14 because ValueError if bargap not in [0, 1]
70 ax.barh(
71 bottom=D["multi_bottom"],
72 width=D["multi_width"],
73 height=14,
74 color="red",
75 alpha=0.5,
76 )
77 renderer = run_fig(fig)
78 for data_no, data_dict in enumerate(renderer.plotly_fig["data"]):
79 d1, d2 = strip_dict_params(
80 data_dict, H_AND_V_BARS["data"][data_no], ignore=["uid"]
81 )
82
83 equivalent, msg = compare_dict(d1, d2)
84 assert equivalent, msg
85
86 equivalent, msg = compare_dict(
87 renderer.plotly_fig["layout"], H_AND_V_BARS["layout"]
88 )
89 assert equivalent, msg

Callers

nothing calls this directly

Calls 5

run_figFunction · 0.85
strip_dict_paramsFunction · 0.85
compare_dictFunction · 0.85
subplotsMethod · 0.80
barMethod · 0.45

Tested by

no test coverage detected