MCPcopy
hub / github.com/matplotlib/matplotlib / gca

Method gca

lib/matplotlib/figure.py:1716–1727  ·  view source on GitHub ↗

Get the current Axes. If there is currently no Axes on this Figure, a new one is created using `.Figure.add_subplot`. (To test whether there is currently an Axes on a Figure, check whether ``figure.axes`` is empty. To test whether there is currently a Figu

(self)

Source from the content-addressed store, hash-verified

1714 return a
1715
1716 def gca(self):
1717 """
1718 Get the current Axes.
1719
1720 If there is currently no Axes on this Figure, a new one is created
1721 using `.Figure.add_subplot`. (To test whether there is currently an
1722 Axes on a Figure, check whether ``figure.axes`` is empty. To test
1723 whether there is currently a Figure on the pyplot figure stack, check
1724 whether `.pyplot.get_fignums()` is empty.)
1725 """
1726 ax = self._axstack.current()
1727 return ax if ax is not None else self.add_subplot()
1728
1729 def _gci(self):
1730 # Helper for `~matplotlib.pyplot.gci`. Do not use elsewhere.

Callers 15

test_fill_facecolorFunction · 0.80
colorbarMethod · 0.80
gcaFunction · 0.80
test_simpleFunction · 0.80
test_toolbar_zoompanFunction · 0.80
test_stem_removeFunction · 0.80
test_errorbar_removeFunction · 0.80
test_pngsuiteFunction · 0.80

Calls 2

add_subplotMethod · 0.95
currentMethod · 0.80

Tested by 15

test_fill_facecolorFunction · 0.64
test_simpleFunction · 0.64
test_toolbar_zoompanFunction · 0.64
test_stem_removeFunction · 0.64
test_errorbar_removeFunction · 0.64
test_pngsuiteFunction · 0.64
test_colorbarbaseFunction · 0.64
test_legend_no_argsMethod · 0.64