Python - matplotlib - PyQT: plot to QPixmap -
i want visualise matplotlibs colormaps (similar http://matplotlib.org/examples/color/colormaps_reference.html) , use qpixmaps in pyqt widgets. idea create plots in matplotlib without showing (or saving file) , convert qpixmap. solution offered here (python - matplotlib - pyqt: copy image clipboard) doesn't seem work, maybe because don't want show matplotlib plot.
i have tried following , works:
def testcolourmap(cmap): sp = subplotparams(left=0., bottom=0., right=1., top=1.) fig = figure((2.5,.2), subplotpars = sp) canvas = figurecanvas(fig) ax = fig.add_subplot(111) gradient = np.linspace(0, 1, 256) gradient = np.vstack((gradient, gradient)) ax.imshow(gradient, aspect=10, cmap=cmap) ax.set_axis_off() canvas.draw() size = canvas.size() width, height = size.width(), size.height() im = qimage(canvas.buffer_rgba(), width, height, qimage.format_argb32) return qpixmap(im)
Python - Matplotlib - Pyqt: Plot To Qpixmap - >>>>> Download Now
ReplyDelete>>>>> Download Full
Python - Matplotlib - Pyqt: Plot To Qpixmap - >>>>> Download LINK
>>>>> Download Now
Python - Matplotlib - Pyqt: Plot To Qpixmap - >>>>> Download Full
>>>>> Download LINK q3