justnoise / termplot

Plot data in your terminal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

termplot

A quickly slapped together ASCII plotting library. It can do line plots and histograms. I created this to easily view plots of timeseries data when sshing into servers.

Usage

import math
from termplot import Plot
xvals, yvals = [], []
for i in range(0, 2000, 5):
    xx = i / 100.0
    xvals.append(xx)
    yvals.append(math.sin(xx) * float(i ** 0.5))
Plot(xvals, yvals, LINE)

Line plot

import random
xvals = []
for i in range(100000):
    xvals.append(random.gauss(0, 1.5))
Plot(xvals, plot_type=HISTOGRAM)

Histogram plot

Bugs and Todo

  • The code is crazy ugly
  • No axis titles
  • No plot title
  • Allow piping of data from stdin

About

Plot data in your terminal


Languages

Language:Python 100.0%