Skip to main content

Python3 module to resample datasetsbefore plotting with Plotille.

Project description


Python3 module to resample datasets before plotting with Plotille.


I want to optimize plot and scatter function of plotille.


Install with pip

pip3 install -U servusresample


#!/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)}")

print(plotille.plot(xp, yp, w, h))

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.

Files for plotilleresample, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size plotilleresample-0.1.tar.gz (2.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page