matplotlib.figure.Figure.gca#

Figure.gca()[源代码]#

获取当前的 Axes。

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