【问题标题】:python subplot command is not working correctlypython subplot 命令无法正常工作
【发布时间】:2022-10-16 14:46:22
【问题描述】:

我正在尝试在 python 中以 3 x 3 格式创建 9 个子图,但即使在线存在大量代码示例,我输入的确切参数也存在,出于某种原因,pyCharm 坚持需要 1 或 3 个参数而不是 2:

fig, plot_order = plot.subplot(3,3)

错误信息:

Traceback (most recent call last):
...
TypeError: subplot() takes 1 or 3 positional arguments but 2 were given

【问题讨论】:

  • Python 本身不作图;请确定您用于执行此操作的模块。
  • The documentation 用于 matplolib 的 subplot 方法提供有关使用 3 调用它并使用 1 调用它但不使用 2 个参数调用它的信息。

标签: python


【解决方案1】:

用“子图”替换“子图”,如下所示: 无花果,plot_order = plot.subplots(3,3)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多