Python';s PyQtGraph:有可能有一个渐变填充图吗?

Python';s PyQtGraph:有可能有一个渐变填充图吗?,python,pyqtgraph,Python,Pyqtgraph,是否可以使用PyQtGraph生成这样的图?我知道如何创建填充图,但找不到任何将渐变应用于填充区域的示例 查看画笔并在屏幕上设置FillLevel。可以使用PyQt的渐变设置笔刷 from PyQt4 import QtCore, QtGui import pyqtgraph as pg import numpy as np win = pg.GraphicsWindow() grad = QtGui.QLinearGradient(0, 0, 0, 3) grad.setColorAt(0

是否可以使用PyQtGraph生成这样的图?我知道如何创建填充图,但找不到任何将渐变应用于填充区域的示例


查看画笔并在屏幕上设置FillLevel。可以使用PyQt的渐变设置笔刷

from PyQt4 import QtCore, QtGui
import pyqtgraph as pg
import numpy as np

win = pg.GraphicsWindow()

grad = QtGui.QLinearGradient(0, 0, 0, 3)
grad.setColorAt(0.1, pg.mkColor('#000000'))
grad.setColorAt(0.9, pg.mkColor('b'))
brush = QtGui.QBrush(grad)

p = win.addPlot(y=3+np.random.normal(size=50), brush=brush, fillLevel=0)

import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
    QtGui.QApplication.instance().exec_()

查看画笔并在屏幕上设置FillLevel。可以使用PyQt的渐变设置笔刷

from PyQt4 import QtCore, QtGui
import pyqtgraph as pg
import numpy as np

win = pg.GraphicsWindow()

grad = QtGui.QLinearGradient(0, 0, 0, 3)
grad.setColorAt(0.1, pg.mkColor('#000000'))
grad.setColorAt(0.9, pg.mkColor('b'))
brush = QtGui.QBrush(grad)

p = win.addPlot(y=3+np.random.normal(size=50), brush=brush, fillLevel=0)

import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
    QtGui.QApplication.instance().exec_()