2013-05-22 4 views
3

저는 pyqtgraph를 사용하고 있습니다. 분산 형 플롯에 대한 범례에 항목을 추가하고 싶습니다.pyqtgraph : 분산 형 플롯에 대한 범례 항목 추가

# -*- coding: utf-8 -*- 
""" 
Demonstrates basic use of LegendItem 

""" 
import initExample ## Add path to library (just for examples; you do not need this) 

import pyqtgraph as pg 
from pyqtgraph.Qt import QtCore, QtGui 

plt = pg.plot() 
plt.setWindowTitle('pyqtgraph example: Legend') 
plt.addLegend() 

c1 = plt.plot([1,3,2,4], pen='r', name='red plot') 
c2 = plt.plot([2,1,4,3], pen='g', fillLevel=0, fillBrush=(255,255,255,30), name='green plot') 
c3 = plt.plot([4,3,2,1], pen=None, symbol='o', symbolPen='y', symbolBrush='r', name="point plot") 


## Start Qt event loop unless running in interactive mode or using pyside. 
if __name__ == '__main__': 
    import sys 
    if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'): 
     QtGui.QApplication.instance().exec_() 

내가 결과적으로 얻을 것은 : plot image

내가 적절한 범례 항목을 추가하려면 어떻게

나는 보여주기 위해 예제 코드를 적용했습니다?

답변