matplot的plot对象如何转换成numpy矩阵?
matplot的plot对象如何转换成numpy矩阵?
fig, ax = plt.subplots() nx.draw(self.g1, ax=ax,node_size=20) fig.canvas.draw() data = np.frombuffer(fig.canvas.tostring_rgb(), dtype=np.uint8) data = data.reshape(fig.canvas.get_width_height()[::-1] + (3,)) self.ivGeneNetwork.setImage(data)