matplotlib으로 그래프를 실시간으로 그리는 것이 너무 느려서 pyqtgraph를 이용해보려고 하는데, 공식 문서부터가 너무 개떡같다.
matplotlib의 경우 다음과 같이 다양한 예제와 설명 + 실행 이미지를 볼 수 있는데, pyqtgraph는 그런게 없다.
하다못해 matplotlib과 같이 class object가 어떤 kwarg를 받는지, 또 해당 인수가 어떤 것을 위해 사용되는지 알 수 있도록 잘 써져있기라도 하면 이해라도 하겠는데...
https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.bar.html#matplotlib.axes.Axes.bar
pyqtgraph는 **opts와 같이 무슨 인수를 받는지 구분도 안되어있다.
docstring으로 어떤 식으로 작동하는지 설명이 있는 경우도 있는데, 문제는 공통 arg를 어떤 식으로 받는지, 어떤 공통 arg를 받지 않는지에 대한 설명은 없다.
BarGraphItem
class pyqtgraph.BarGraphItem(**opts)[source]
__init__(
**opts,
)[source]
Valid keyword options are: x, x0, x1, y, y0, y1, width, height, pen, brush
x specifies the x-position of the center of the bar. x0, x1 specify left and right edges of the bar, respectively. width specifies distance from x0 to x1. You may specify any combination:
x, width x0, width x1, width x0, x1
Likewise y, y0, y1, and height. If only height is specified, then y0 will be set to 0
Example uses:
BarGraphItem(x=range(5), height=[1,5,2,4,3], width=0.5)
https://pyqtgraph.readthedocs.io/en/latest/api_reference/graphicsItems/bargraphitem.html
속도가 빠르면 뭐할까. 이게 어떻게 돌아가는 코드인지도 모르겠고, 어떤 결과가 나올지 미리 확인도 못하는데.
결과를 보기 위해 코드를 한참 작성해야 하고, 그마저도 중간에 에러가 터지면 그거 수정하느라 한세월이 걸리고, 그렇게 고생해서 만든 결과가 원하던 결과가 아니면 시간만 잔뜩 날려먹게 만드는. 정말 비효율적인 문서다....