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) 

Comments

  1. Python - Matplotlib - Pyqt: Plot To Qpixmap - >>>>> Download Now

    >>>>> Download Full

    Python - Matplotlib - Pyqt: Plot To Qpixmap - >>>>> Download LINK

    >>>>> Download Now

    Python - Matplotlib - Pyqt: Plot To Qpixmap - >>>>> Download Full

    >>>>> Download LINK q3

    ReplyDelete

Post a Comment

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -