plot-cat is the python library for plotting live (real time) serial input.
Python
Switch branches/tags
Nothing to show
Latest commit f390967 Jun 3, 2017 @girish946 girish946 examples corrected
Permalink
Failed to load latest commit information.
dist doc init Mar 10, 2017
docs doc init Mar 10, 2017
examples
plotcat
.travis.yml travis.yml changed Jan 16, 2017
LICENSE Initial commit Aug 9, 2016
MANIFEST.in added corrected .spec and srpm Sep 23, 2016
README.md examples corrected Jun 3, 2017
live_plot.py solved problems for multiple values for multiple attributes Oct 26, 2016
python-plotcat.spec spec file changed. build env changed Jan 16, 2017
requirements.txt readme updated requirements.txt added Aug 13, 2016
setup.py doc init Mar 10, 2017
tox.ini

README.md

plot-cat

Alt build status

plot-cat is the python library for plotting live serial input. plotcat works on python 2.7 and later. plotcat comes handy when you want to plot live data that is coming form different sensors over the serial port, SPI, websocket, tcp socket etc.

For example you have to plot the output of a temperature sensor that is coming from an arduino or any other microcontroller for that matter; plotcat comes handy for such tasks.

plotcat sits on the top of matplotlib and does all the initialization and drawing stuff itself. you just have to provide the list of values to be plotted.

plotcat works on linux osx and windows. plotcat also works well with Raspberry Pi

install plotcat

from pip

pip install plotcat

or from github

git clone https://github.com/girish946/plot-cat.git

pip install -r requirements.txt

python install setup.py install

on fedora 22 and above

dnf copr enable girish946/plotcat

dnf install python-plotcat

for ubuntu

wget https://github.com/girish946/plot-cat/blob/master/dist/python-plotcat_1.0.0.1-1_all.deb

sudo dpkg -i python-plotcat_1.0.0.1-1_all.deb

usage

To plot the incomming input from serial device directly.

Assuming there is one value on one line in the serial input, ie. the format of the serial input is roughly like:

val | \r | \n
-----|----|----

python live_plot.py -d /dev/tty<device> -b baudrate

detailed usage of live_plot.py

plot-cat api

To use plot-cat api.

import serial
from plotcat import *

p = plotter()

#init serial device
ser = serial.Serial('/dev/ttyACM', 9600)

#the callback function for plotting
@p.plot_self
def update_plot():

  data = [ser.readline() for i in range(100)]
  p.lines[0][0].set_data(p.currentAxis[0], data)

p.set_call_back(update_plot)
plotter.show()

You can use plotcat for plotting live data from SPI,

this is the example to recive the data from arduino (given in the example->communication->SerialEvent of the arduino IDE.)