我对"subplot_mosaic“有问题,因为Spyder找不到它。是不是因为这个版本?
“守则”:
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gs
# Subplot_Mosaic
layout = [["logo", "text"],["bar", "bar"]]
fig = plt.figure(figsize = (5,5))
ax_dict = fig.subplot_mosaic(layout)
ax_dict["logo"].annotate(
xy = (.5,.5),
text = "logo",
ha = "center",
va = "center",
size = 20
)
ax_dict["text"].annotate(
xy = (.5,.5),
text = "text",
ha = "center",
va = "center",
size = 20
)
ax_dict["bar"].annotate(
xy = (.5,.5),
text = "bar",
ha = "center",
va = "center",
size = 20
) 这很奇怪,因为我有合适的图书馆。我还在这里看了看:马特洛梅赛克子图
密码应该是对的。这也是来自一个教程。
有人看到问题了吗?
发布于 2022-10-28 17:17:07
将版本更新为: Maptlotlib 3.6.1解决了问题!
感谢:@BigBen
https://stackoverflow.com/questions/74238189
复制相似问题