Duplicated from jyseo/3DFuse
d661b19
1
2
3
4
5
6
7
8
9
10
import numpy as np import matplotlib.pyplot as plt def mpl_fig_to_buffer(fig): fig.canvas.draw() plot = np.array(fig.canvas.renderer.buffer_rgba()) plt.close(fig) return plot