matplotlib.pyplot.gca#

matplotlib.pyplot.gca()[源代码][源代码]#

获取当前的 Axes。

如果当前这个 Figure 中没有 Axes,则使用 Figure.add_subplot 创建一个新的 Axes。(要测试当前 Figure 中是否有 Axes,检查 figure.axes 是否为空。要测试当前 pyplot 的 figure 栈中是否有 Figure,检查 pyplot.get_fignums() 是否为空。)

注释

备注

这是 Figure.gcapyplot 包装器

使用 matplotlib.pyplot.gca 的示例#

带注释的热图

Annotated heatmap

在 pyplot 中管理多个图形

Manage multiple figures in pyplot

尺度不变角度标签

Scale invariant angle label

无限行

Infinite lines

设置和获取属性

Set and get properties

Hinton 图

Hinton diagrams

紧凑布局指南

Tight layout guide