MCPcopy Create free account
hub / github.com/spotify/chartify / _bar_example_2

Function _bar_example_2

chartify/examples.py:423–435  ·  view source on GitHub ↗

# Plot the data ordered by the categorical axis labels

(quantity_by_fruit)

Source from the content-addressed store, hash-verified

421
422@_print_source
423def _bar_example_2(quantity_by_fruit):
424 """# Plot the data ordered by the categorical axis labels"""
425 ch = chartify.Chart(blank_labels=True, x_axis_type="categorical")
426 ch.set_title("Vertical bar plot - Label sort")
427 ch.set_subtitle("Set `categorical_order_by` to sort by labels")
428 ch.plot.bar(
429 data_frame=quantity_by_fruit,
430 categorical_columns="fruit",
431 numeric_column="quantity",
432 categorical_order_by="labels",
433 categorical_order_ascending=True,
434 )
435 ch.show(_OUTPUT_FORMAT)
436
437
438@_print_source

Callers 1

plot_barFunction · 0.85

Calls 4

set_titleMethod · 0.95
set_subtitleMethod · 0.95
showMethod · 0.95
barMethod · 0.80

Tested by

no test coverage detected