How to use the termplotlib.barh.barh function in termplotlib

To help you get started, we’ve selected a few termplotlib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nschloe / termplotlib / termplotlib / hist.py View on Github external
max_width=40,
    bins=20,
    bar_width=1,
    show_bin_edges=True,
    show_counts=True,
    force_ascii=False,
):
    if show_bin_edges:
        labels = [
            "{:+.2e} - {:+.2e}".format(bin_edges[k], bin_edges[k + 1])
            for k in range(len(bin_edges) - 1)
        ]
    else:
        labels = None

    out = barh(
        counts,
        labels=labels,
        max_width=max_width,
        bar_width=bar_width,
        show_vals=show_counts,
        force_ascii=force_ascii,
    )

    return out