Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

convert plt image to numpy

canvas = pyplot.gca().figure.canvas
canvas.draw()
data = numpy.frombuffer(canvas.tostring_rgb(), dtype=numpy.uint8)
image = data.reshape(canvas.get_width_height()[::-1] + (3,))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #plt #image #numpy
ADD COMMENT
Topic
Name
4+6 =