Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/b-per/asciichartpyx
https://github.com/b-per/asciichartpyx
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/b-per/asciichartpyx
- Owner: b-per
- License: mit
- Created: 2023-07-10T15:07:53.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-26T08:31:55.000Z (over 1 year ago)
- Last Synced: 2023-07-26T09:50:04.013Z (over 1 year ago)
- Language: Python
- Size: 43 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE.MD
Awesome Lists containing this project
README
# asciichartpyx
Copy of the Python implementation of [asciichart](https://github.com/kroitor/asciichart) and translation from JS to Python of [this comment](https://github.com/kroitor/asciichart/issues/56#issuecomment-1320508054) to support adding X axis as well as labels and a title
## Example
The following example (also in `demo.py`) cab be run
```python
import asciichartpy as asciichart
from asciichartpyx import plot
import randommyl1 = [random.uniform(-5, 5) for _ in range(300)]
myl2 = [random.expovariate(1/8) for _ in range(300)]
myl3 = [random.uniform(10, 50) for _ in range(300)]
myx = [x * 100 for x in range(len(myl1))]config = {
"title": "this is an interesting graph",
"height": 15,
"width": 150,
"colors": [
asciichart.blue,
asciichart.green,
asciichart.lightcyan,
],
"line_labels": [
"precision",
"recall",
"nothing"
],
"x_label": "threshold",
"y_label": "percent",
"x_array": myx,
"format": "{:5.1f}",
}val = plot([myl1, myl2, myl3], config)
print(val)
```![Alt text](image.png)