Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fig, ax = plt.subplots()
- ax.text(0.0,0.0,"Test", fontsize=45)
- ax.axis('off')
- ax.imshow(np.random.random((3,3)))
- with io.BytesIO() as memf:
- fig.savefig(memf, format='PNG')
- memf.seek(0)
- img = Image.open(memf).convert('RGB')
- arr = np.asarray(img)
- img.show()
- plt.show()
- print(arr)
Add Comment
Please, Sign In to add comment