Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Milestone
Description
importmatplotlib.pyplotaspltimportmatplotlib.axesasmaxesfig=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
importmatplotlib.pyplotaspltimportmatplotlib.axesasmaxesfrommpl_toolkits.mplot3dimportAxes3Dfig=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:
self.figure.add_axes(self) |
whereas no such thing happens for the baseAxes
class.
Discovered as part of#18356, but discussing here because its orthogonal. But I think the behaviour here should be the same .