首页 > 解决方案 > 将 svg 图像添加到 matplotlib 中的子图

问题描述

所以这里是生成深色背景子图的简单代码:-

import matplotlib.pyplot as plt

fig, ax = plt.subplots(figsize=(6,6), facecolor='black')
ax.set_facecolor('black')

我希望将这个格式的图像.svg添加到子图中。在使用 PIL时Image.open()plt.imread我得到了UnidentifiedImageError. 我应该怎么做才能读取.svg文件并将其添加到子图中。

标签: pythonmatplotlibsvg

解决方案


推荐阅读