2
필자는 pyqtgraph로 시간 세리에를 그려 봅니다. this, this 및 this을 읽었습니다. 하지만 올바르게 사용하는 방법을 모르겠습니다.pyqtgraph, 시계열을 그리는 중
내 플롯 플롯 위젯입니다, 나는 그것을 이런 식으로 사용
graph.plot(aerosol_data, pen=pg.mkPen(color=colors[count], width=1, style=QtCore.Qt.SolidLine), axisItems={'bottom': TimeAxisItem(orientation='bottom')})
가 TimeAxisItem는 다음과 같이 정의된다 : ISO_dates는 ISO 날짜와 시간의 목록입니다
class TimeAxisItem(pg.AxisItem):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def tickStrings(self, values, scale, spacing):
# PySide's QTime() initialiser fails miserably and dismisses args/kwargs
return [useful_values_dict['useful_data']['data']['ISO_dates']]
graph.plotItem.plot(aerosol_data, pen=pg.mkPen(color=colors[count], width=1, style=QtCore.Qt.SolidLine), axisItems={'bottom': TimeAxisItem(orientation='bottom')})
: 형식
나는 또한이 시도했습니다
하지만 효과가 없습니다 (축 문자열은 stil 번호 임).
는 다음 나는 DateTimeAxis.py, 이런 식으로 사용하려고 :date_axis = pg.DateAxisItem('bottom', pen=None, linkView=None, parent=None, maxTickLength=-1, showValues=True)
date_axis.tickStrings(useful_values_dict['useful_data']['data']['timestamp_dates'],1, 1)
을하지만 난 오류 얻을 : 나는 결국 내 문제를 해결
File "C:\Python34\lib\site-packages\pyqtgraph\graphicsItems\DateAxisItem.py", line 161, in tickStrings
format_strings.append(x.strftime(tick_spec.format))
AttributeError: 'NoneType' object has no attribute 'format'
그런 다음 자유롭게 답을 수락하십시오. –
나는 내가 할 수 있으면 좋겠지 만, 내가 질문 한 계정에 대해 내 비밀번호 나 이메일을 기억하지 못한다. – beni