# Plot the data ordered by the categorical axis labels
(quantity_by_fruit)
| 421 | |
| 422 | @_print_source |
| 423 | def _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 |
no test coverage detected