#pyqtgraph has superpowers from Qt
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtGui
import numpy as np
#using dimensions in pixel coordinates, i guess screen size wise
w, h = 800, 600
lg0 = QtGui.QRadialGradient(w/2, h/2, h/2, w/2, h/2) #(cx, cy, radius, fx, fy)
lg0.setColorAt(0, pg.mkColor('#ffffff'))
lg0.setColorAt(1, pg.mkColor('#ee00ee'))
backgroundbrush = QtGui.QBrush(lg0) #qBrush with the gradient
lg1 = QtGui.QLinearGradient(w/2, 0, w/2, h) #(xstart, ystart, xstop, ystop)
lg1.setColorAt(0.2, pg.mkColor('#000000'))
lg1.setColorAt(0.8, pg.mkColor('#ffffff'))
pen = QtGui.QPen(lg1, 1) #qPen with this gradient
data = np.random.random(100) *h #scale up height to gradient screen pixels
pg.plot(data, pen=pen, background=backgroundbrush)
import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()
'''
http://pyqt.sourceforge.net/Docs/PyQt4/qradialgradient.html
http://pyqt.sourceforge.net/Docs/PyQt4/qlineargradient.html
http://pyqt.sourceforge.net/Docs/PyQt4/qbrush.html
http://pyqt.sourceforge.net/Docs/PyQt4/qpen.html
'''