def fig2data (fig):
    # draw the renderer
    fig.canvas.draw ( )

    # Get the RGBA buffer from the figure
    w,h = fig.canvas.get_width_height()
    buf = numpy.fromstring ( fig.canvas.tostring_argb(), dtype=numpy.uint8 )
    buf.shape = ( w, h, 4 )

    # canvas.tostring_argb give pixmap in ARGB mode. Roll the ALPHA channel to have it in RGBA mode
    buf = numpy.roll ( buf, 3, axis = 2 )
    return buf
Returns the first element of the sequence.
dataset/ETHPy150Open victor-gil-sepulveda/pyProCT/pyproct/tools/plotTools.py/fig2data--crossover with--dataset/ETHPy150Open EntilZha/PyFunctional/functional/pipeline.py/Sequence.first