1# -*- coding: utf-8 -*- 2""" 3Very simple example demonstrating RemoteGraphicsView. 4 5This allows graphics to be rendered in a child process and displayed in the 6parent, which can improve CPU usage on multi-core processors. 7""" 8import initExample ## Add path to library (just for examples; you do not need this) 9 10from pyqtgraph.Qt import QtGui, QtCore 11import pyqtgraph as pg 12from pyqtgraph.widgets.RemoteGraphicsView import RemoteGraphicsView 13app = pg.mkQApp() 14 15## Create the widget 16v = RemoteGraphicsView(debug=False) # setting debug=True causes both processes to print information 17 # about interprocess communication 18v.show() 19v.setWindowTitle('pyqtgraph example: RemoteGraphicsView') 20 21## v.pg is a proxy to the remote process' pyqtgraph module. All attribute 22## requests and function calls made with this object are forwarded to the 23## remote process and executed there. See pyqtgraph.multiprocess.remoteproxy 24## for more inormation. 25plt = v.pg.PlotItem() 26v.setCentralItem(plt) 27plt.plot([1,4,2,3,6,2,3,4,2,3], pen='g') 28 29if __name__ == '__main__': 30 pg.exec() 31