Guest User

Untitled

a guest
Nov 23rd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. fig = Figure()
  2. canvas = FigureCanvas(fig)
  3. ax = fig.gca()
  4.  
  5. ax.text(0.0,0.0,"Test", fontsize=45)
  6. ax.axis('off')
  7. canvas.draw() # draw the canvas, cache the renderer
  8. width, height = fig.get_size_inches() * fig.get_dpi()
  9. images = np.fromstring(canvas.tostring_rgb(), dtype='uint8').reshape(int(height), int(width), 3)
Add Comment
Please, Sign In to add comment