Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fig = Figure()
- canvas = FigureCanvas(fig)
- ax = fig.gca()
- ax.text(0.0,0.0,"Test", fontsize=45)
- ax.axis('off')
- canvas.draw() # draw the canvas, cache the renderer
- width, height = fig.get_size_inches() * fig.get_dpi()
- images = np.fromstring(canvas.tostring_rgb(), dtype='uint8').reshape(int(height), int(width), 3)
Add Comment
Please, Sign In to add comment