相关疑难解决方法(0)

在Matplotlib中,参数在fig.add_subplot(111)中意味着什么?

有时我遇到这样的代码:

import matplotlib.pyplot as plt
x = [1, 2, 3, 4, 5]
y = [1, 4, 9, 16, 25]
fig = plt.figure()
fig.add_subplot(111)
plt.scatter(x, y)
plt.show()
Run Code Online (Sandbox Code Playgroud)

哪个产生:

由包含的代码生成的示例图

我一直在疯狂阅读文档,但我无法找到解释111.有时我看到了212.

这个论点fig.add_subplot()意味着什么?

python matplotlib figure

439
推荐指数
7
解决办法
26万
查看次数

标签 统计

figure ×1

matplotlib ×1

python ×1