赞
踩
import numpy as np import pyqtgraph as pg from scipy.ndimage import gaussian_filter app = pg.mkQApp("Plotting Example") win = pg.GraphicsLayoutWidget(show=True, title="Basic plotting examples") win.resize(1200, 600) win.setWindowTitle('pyqtgraph example: Plotting') plot1 = win.addPlot(title="Multiple curves") # win.nextRow() plot2 = win.addPlot(title="Multiple curves") imData = np.random.normal(size=(100, 100))*100 imData[10,30] =4000 imData[50, 80] = 2000 imData[50, 80] = 6000 imData = gaussian_filter(imData,3) img = pg.ImageItem(imData) img2 = pg.ImageItem(imData) plot1.addItem(img) plot1.addColorBar(img, colorMap='CET-R4', values=(-100, 100)) # , interactive=False) plot2.addItem(img2) plot2.addColorBar(img2, colorMap=pg.colormap.get('hsv', source='matplotlib', skipCache=True), values=(-100, 100)) # , interactive=False) pg.exec()
结果如下:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。