FastPlot

기간: 2022년 5월

코드

한눈에

요약
시리얼 포트로 들어오는 값을 실시간 애니메이션으로 그리는 파이썬 라이브러리다.
왜
아두이노에서 올라오는 값을 눈으로 확인하려면 그때마다 matplotlib 애니메이션 루프를 새로 짜야 한다.
어떻게
포트와 그릴 항목만 넘기면 갱신 루프와 축 관리를 라이브러리가 맡는다.

만든 것

전체 코드는 GitHub 페이지에 있다 (https://github.com/auejin/FastPlot).

사용 예

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()