gpt4 book ai didi

python - matplotlib的mpl_toolkits.axes_grid1中host_subplot的参数是什么?

转载 作者:太空宇宙 更新时间:2023-11-03 11:26:08 25 4
gpt4 key购买 nike

我正在尝试了解如何 this Matplotlib example绘制了图,因此我可以从中导出我自己的程序:

enter image description here

第一行代码是

host = host_subplot(111, axes_class=AA.Axes)

我正试图弄清楚这些参数是什么,以避免将来出现“神奇的源代码”。调用 pydoc 没什么用:

$ pydoc2.7 mpl_toolkits.axes_grid1.host_subplot
Help on function host_subplot in mpl_toolkits.axes_grid1:
mpl_toolkits.axes_grid1.host_subplot = host_subplot(*args, **kwargs)

图书馆source code不是很有启发性:

def host_subplot(*args, **kwargs)

此外,在我的搜索中,我发现很多这样的例子都有那个神奇的 111 参数,但我不知道它有什么作用。

谁能帮我弄清楚:

  1. host_subplot() 的参数是什么
  2. pydoc 和在线文档失败时,如何自己找出这个问题?

最佳答案

我不确定在哪里可以找到有关 host_subplot 的更多信息(我想你已经看到了 this page ?),但是 111参数必须传递到 subplot在某些时候,并且是说 1 row 的简写, 1 column , plot number 1 .

From the docs:

Typical call signature:

subplot(nrows, ncols, plot_number)

Where nrows and ncols are used to notionally split the figure into nrows * ncols sub-axes, and plot_number is used to identify the particular subplot that this function is to create within the notional grid. plot_number starts at 1, increments across rows first and has a maximum of nrows * ncols.

关于python - matplotlib的mpl_toolkits.axes_grid1中host_subplot的参数是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33396190/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com