Axes objects need correct wiring up with the figure. Therefore, you never instantiate any Axes directly, but use the Axes creation methods on Figure (or pyplot), which do that logic for you.I think this is consistently shown throughout our documentation. Have you found a place that suggests otherwise?
Todo: Maybe we should add a note to Axes constructors that they are not intended for the end-user.
"Changed in version 1.0.0: Prior to Matplotlib 1.0.0, only a single Axes3D could be created per figure; it needed to be directly instantiated as ax = Axes3D(fig)."
This can possibly be dropped now? But also it indicates that there are old examples out there using this.
(Some tests use ax = fig.add_axes(Axes3D(fig)) so that is, I guess, the way to do it if one really wants to instantiate it separately, but not the way to go.)
Activity
timhoffm commented on Dec 6, 2022
Axes objects need correct wiring up with the figure. Therefore, you never instantiate any Axes directly, but use the Axes creation methods on Figure (or pyplot), which do that logic for you.I think this is consistently shown throughout our documentation. Have you found a place that suggests otherwise?
Todo: Maybe we should add a note to Axes constructors that they are not intended for the end-user.
oscargus commented on Dec 6, 2022
There is a note here: https://matplotlib.org/stable/tutorials/toolkits/mplot3d.html
"Changed in version 1.0.0: Prior to Matplotlib 1.0.0, only a single Axes3D could be created per figure; it needed to be directly instantiated as ax = Axes3D(fig)."
This can possibly be dropped now? But also it indicates that there are old examples out there using this.
(Some tests use ax = fig.add_axes(Axes3D(fig)) so that is, I guess, the way to do it if one really wants to instantiate it separately, but not the way to go.)
Add note that users do not instantiate Axes directly
Add note that users do not instantiate Axes directly
tacaswell commented on Dec 14, 2022
Between this issue and #24725 what is happening that this came up 2x in a week or so but not for the last 4 months from when 3.6 came out?
Add note that users do not instantiate Axes directly
Add note that users do not instantiate Axes directly
Add note that users do not instantiate Axes directly
Add note that users do not instantiate Axes directly