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

Function test_grouped_bar_dataframe

lib/matplotlib/tests/test_axes.py:2277–2290  ·  view source on GitHub ↗
(fig_test, fig_ref, pd)

Source from the content-addressed store, hash-verified

2275
2276@check_figures_equal()
2277def test_grouped_bar_dataframe(fig_test, fig_ref, pd):
2278 categories = ['A', 'B']
2279 labels = ['data1', 'data2', 'data3']
2280 df = pd.DataFrame([[1, 2, 3], [1.2, 2.4, 3.6]],
2281 index=categories, columns=labels)
2282
2283 ax = fig_test.subplots()
2284 ax.grouped_bar(df)
2285 ax.legend()
2286
2287 ax = fig_ref.subplots()
2288 list_of_datasets = [df[col].to_numpy() for col in df.columns]
2289 ax.grouped_bar(list_of_datasets, tick_labels=categories, labels=labels)
2290 ax.legend()
2291
2292
2293def test_grouped_bar_return_value():

Callers

nothing calls this directly

Calls 3

grouped_barMethod · 0.80
subplotsMethod · 0.45
legendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…