def _bar_example_4()

in chartify/examples.py [0:0]


def _bar_example_4(quantity_by_fruit):
    """# Plot the data with labels"""
    ch = chartify.Chart(x_axis_type="categorical", blank_labels=True)
    ch.set_title("Vertical bar plot with labels")
    ch.set_subtitle("Hidden y-axis")
    ch.plot.bar(
        data_frame=quantity_by_fruit,
        categorical_columns="fruit",
        numeric_column="quantity",
        color_column="fruit",
    )
    ch.style.color_palette.reset_palette_order()
    ch.plot.text(
        data_frame=quantity_by_fruit,
        categorical_columns="fruit",
        numeric_column="quantity",
        text_column="quantity",
        color_column="fruit",
    )
    # Adjust the axis range to prevent clipping of the text labels.
    ch.axes.set_yaxis_range(0, 1200)
    ch.axes.hide_yaxis()
    ch.show(_OUTPUT_FORMAT)