bashplotlib Documentation

repository·master·Indexed 24 days ago

https://github.com/glamp/bashplotlib

A lightweight Python package and CLI tool for creating basic plots, such as histograms and scatter plots, directly in the terminal. Includes the hist and scatter command-line tools and Python functions plot_hist and plot_scatter for data visualization in environments without a GUI.

Tokens
434
Snippets
5
Records
5
Agent score
34%

What's inside bashplotlib

  1. Install bashplotlib via pip

    master

    You can install the bashplotlib package using pip. This will install the python package and add the hist and scatter command-line tools to your python scripts folder. Ensure your python scripts folder is in your system PATH.

    $ pip install bashplotlib
  2. Use bashplotlib in Python

    master

    To use plotting functionality within your Python scripts, import plot_hist from bashplotlib.histogram or plot_scatter from bashplotlib.scatterplot.

    from bashplotlib.scatterplot import plot_scatter
    from bashplotlib.histogram import plot_hist
  3. Use the hist command line tool

    master

    The hist command creates histograms in the terminal. It accepts a single column of numbers as input. You can provide data via stdin or by specifying a file using the -f parameter.

    $ hist --file data/exp.txt
  4. Use the scatter command line tool

    master

    The scatter command creates scatter plots in the terminal. It accepts x and y coordinates in two ways:

    1. A single comma-delimited file using the -f parameter.
    2. Two separate files using the -x and -y parameters.

    You can also customize the point character using --pch.

    $ scatter --file data/texas.txt --pch .
    # OR
    $ scatter -x data/x_test.txt -y data/y_test.txt