Closed
Description
import matplotlib.pyplot as plt
import matplotlib.axes as maxes
fig = plt.figure()
ax = maxes.Axes(fig, [0.1, 0.1, 0.9, 0.9])
print(fig.get_children())
returns a list with no axes....
[<matplotlib.patches.Rectangle object at 0x7f8d75707dc0>]
For 3-d
import matplotlib.pyplot as plt
import matplotlib.axes as maxes
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = Axes3D(fig)
print(fig.get_children())
has the axes attached:
[<matplotlib.patches.Rectangle object at 0x7fbc2968d160>, <mpl_toolkits.mplot3d.axes3d.Axes3D object at 0x7fbc2968df40>]
Axes3D.__init__
explicitly adds itself to its parent:
matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py
Line 139 in c035f66
whereas no such thing happens for the base Axes
class.
Discovered as part of #18356, but discussing here because its orthogonal. But I think the behaviour here should be the same .