MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_as_mpl_axes_api

Function test_as_mpl_axes_api

lib/matplotlib/tests/test_axes.py:3348–3370  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3346
3347
3348def test_as_mpl_axes_api():
3349 # tests the _as_mpl_axes api
3350 class Polar:
3351 def __init__(self):
3352 self.theta_offset = 0
3353
3354 def _as_mpl_axes(self):
3355 # implement the matplotlib axes interface
3356 return PolarAxes, {'theta_offset': self.theta_offset}
3357
3358 prj = Polar()
3359 prj2 = Polar()
3360 prj2.theta_offset = np.pi
3361
3362 # testing axes creation with plt.axes
3363 ax = plt.axes((0, 0, 1, 1), projection=prj)
3364 assert type(ax) is PolarAxes
3365 plt.close()
3366
3367 # testing axes creation with subplot
3368 ax = plt.subplot(121, projection=prj)
3369 assert type(ax) is PolarAxes
3370 plt.close()
3371
3372
3373def test_pyplot_axes():

Callers

nothing calls this directly

Calls 3

PolarClass · 0.85
axesMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…