获取描述任意matplolib/seaborn p的numpy数组

2024-04-20 10:22:44 发布

您现在位置:Python中文网/ 问答频道 /正文

有没有可能得到描述任意matplolib/seaborn绘图的numpy数组而不显式地将其保存为图像文件并读取它

例如,假设我有一个附加的图像,它是数组的sns.kdeplot()。现在,我可以得到这个图的numpy数组而不需要先saving it to a file读取它吗?比如:

img = sns.kdeplot(arr)
img_arr = img.some_function() # Returns a numpy array describing the plot

enter image description here


Tags: to图像numpy绘图img图像文件it数组