Python3 module to resample datasetsbefore plotting with Plotille.
Project description
plotilleresample
Python3 module to resample datasets before plotting with Plotille.
Rationale
I want to optimize plot and scatter function of plotille.
Installation
Install with pip
pip3 install -U servusresample
Usage
#!/usr/bin/env python3
import plotille
import plotilledimreduction
import math
from shutil import get_terminal_size
from vtclear import clear_screen
import numpy as np
w = get_terminal_size().columns - 20
h = get_terminal_size().lines - 7
r = 10000
res = np.random.normal(size=r)
# Here I'm testing stuffs with histograms.
# input("Histogram:")
# print(plotille.histogram(res, bins=w*2, width=w, height=h))
X = [i for i in range(r)]
Y = [math.sin(i / 100) * 100 for i in range(r)]
print(" · Scatter...")
xs, ys = plotilledimreduction.dim_reduction_scatter(X, Y, w, h)
print(" · Plot...")
xp, yp = plotilledimreduction.dim_reduction_plot(X, Y, w, h)
print(" --- READY ---")
print(f"Len plot.x {len(xp)}")
print(f"Len scatter.x {len(xs)}")
input("Plot:")
clear_screen()
print(plotille.plot(xp, yp, w, h))
input("Scatter:")
clear_screen()
print(plotille.plot(xs, ys, w, h))
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
plotilleresample-0.4.tar.gz
(2.3 kB
view details)
File details
Details for the file plotilleresample-0.4.tar.gz
.
File metadata
- Download URL: plotilleresample-0.4.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a46cf7e0effa4f40ac49c27d6c54c982b589c3517f2155613be5a3472ec9cd78 |
|
MD5 | 316dc4ede3bbaae1b4624df9700a8f5a |
|
BLAKE2b-256 | 99152ee1e1a8fdd664c3ad4c268a57ffde04957f102e50435805bb9f69e7a9ef |