Metadata-Version: 2.1
Name: tplot
Version: 0.3.0
Summary: Create text-based graphs
Home-page: https://github.com/JeroenDelcour/tplot
License: MIT
Author: Jeroen Delcour
Author-email: jeroendelcour@gmail.com
Requires-Python: >=3.6.2,<4.0.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: colorama (>=0.4.3,<0.5.0)
Requires-Dist: importlib-metadata (>=3.1.0,<4.0.0); python_version < "3.8"
Requires-Dist: numpy (>=1.11,<2.0)
Requires-Dist: termcolor (>=1.1.0,<2.0.0)
Project-URL: Repository, https://github.com/JeroenDelcour/tplot
Description-Content-Type: text/markdown

# tplot

[![Documentation status](https://readthedocs.org/projects/tplot/badge/)](https://tplot.readthedocs.io/en/latest/)
 
[![Supported Python versions](https://img.shields.io/pypi/pyversions/tplot)](https://pypi.org/project/tplot/)

`tplot` is a Python module for creating text-based graphs. Useful for visualizing data to the terminal or log files.

## Features

- Scatter plots, line plots, horizontal/vertical bar plots, and image plots
- Supports numerical and categorical data
- Legend
- Unicode characters (with automatic ascii fallback if unicode is not supported)
- Colors (using ANSI escape characters, with Windows support)
- Few dependencies
- Fast and lightweight

## Installation

`tplot` is available on [PyPi](https://pypi.org/project/tplot/):

```bash
pip install tplot
```

## Documentation

Documentation is available on [readthedocs](https://tplot.readthedocs.io/en/latest/).

## Examples

### Basic usage

```python
import tplot

fig = tplot.Figure()
fig.scatter([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
fig.show()
```

![Basic example](docs/images/basic.png)

### A more advanced example

```python
import tplot
import numpy as np

x = np.linspace(start=0, stop=np.pi*3, num=80)

fig = tplot.Figure(
    xlabel="Phase",
    ylabel="Amplitude",
    title="Trigonometric functions",
    legendloc="bottomleft",
    width=60,
    height=15,
)
fig.line(x, y=np.sin(x), color="red", label="sin(x)")
fig.line(x, y=np.cos(x), color="blue", label="cos(x)")
fig.show()
```

![Advanced example](docs/images/advanced.png)

