FastPlot

May 2022

Code

What
A Python library that animates values arriving over a serial port in real time.
Why
Watching what an Arduino is sending means writing a matplotlib animation loop again every time.
How
You pass the port and the fields to draw; the library owns the update loop and the axes.

Abstract

Full code is available at the github page (https://github.com/auejin/FastPlot).

Example

import fastplot as pp
import matplotlib.pyplot as plt

f = lambda y: y+',0,400'

# specify a serial port to read
board = pp.Poller(filter=f)
board.connect('COM7', 115200)
board.start()

# draw a line plot (like a serial plot of Arduino IDE)
anim = pp.LinePlotter(
    labels=['a', 'b', 'c', 'd', 'min', 'max'],
    poller=board, rows=30, delim=',').draw(interval=10)

# display plot animation
plt.show()