You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Axes3d attaches itself to a figure, where as Axes does not #18364
git blame says that line has been there for at least 10 years. This might very well be the case where we used to do this for regular 2D axes, but no longer? Also, there were a lot of oddities with the original Axes3D design 10 years ago that required an inordinate amount of hacks to get it to work. When I revamped it for v1.1.0, I trashed a lot of those hacks and simplified the conceptual model. It very well could be that I simply just missed this.
Heh, just realized that this potentially might explain an old "double-draw" bug...
Thats exactly how I found it - I added a new double-draw bug in #18356 by storing the axes in a flat list instead of an AxesStack which gets rid of duplicates by using a key.
I actually don't mind the idea that an axes attaches itself on instantiation - after all they require a fig as a kwarg so it makes sense. However, it would be preferable if both axes classes were consistent, and if it gets added, it should probably be added to the Axes so that all children classes also get it.
Right now fig.add_axes(ax) only works if ax was created via Axes(fig,...), otherwise it explicitly errors out. So, is there a case where we would create an axes on a figure but not want to also add it to the axes stack?
Ah, right, I think I am starting to remember now. Originally, Axes3D took
up the entire available space because it didn't need to make space for the
axes labels. That ended up changing in v1.1 or v1.2 (iirc) so that it
follows the typical conventions of being a subaxes object under the hood
and had to accept the same hspace/wspace values as everyone else.
We still technically support adding a regular Axes object to a figure
without it being managed by a stack or whatever it was before we had the
stack (gridspec?).
On Thu, Aug 27, 2020 at 10:15 PM Jody Klymak ***@***.***> wrote:
Right now fig.add_axes(ax) only works if ax was created via Axes(fig,...),
otherwise it explicitly errors out. So, is there a case where we would
create an axes on a figure but *not* want to also add it to the axes
stack?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#18364 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACHF6DJOZOKLQYJTYGOS3LSC4HKZANCNFSM4QNETDYA>
.
We still technically support adding a regular Axes object to a figure
without it being managed by a stack or whatever it was before we had the
stack (gridspec?).
I guess you could just add an axes as an artist w/ fig.add_artist(Axes(fig, ...))? I guess if someone wanted it out of the state-based stack (for gca etc) that would be one reason to not enforce a call to add_axes. Given that possibility I'm leaning towards just removing that call from Axes3D and making the user explicitly add all axes...
Activity
jklymak commentedon Aug 27, 2020
Cartopy
GeoAxesdoesn't seem to attach itself either (consistent w/Axes).WeatherGod commentedon Aug 27, 2020
git blame says that line has been there for at least 10 years. This might very well be the case where we used to do this for regular 2D axes, but no longer? Also, there were a lot of oddities with the original Axes3D design 10 years ago that required an inordinate amount of hacks to get it to work. When I revamped it for v1.1.0, I trashed a lot of those hacks and simplified the conceptual model. It very well could be that I simply just missed this.
WeatherGod commentedon Aug 27, 2020
Heh, just realized that this potentially might explain an old "double-draw" bug...
jklymak commentedon Aug 27, 2020
Thats exactly how I found it - I added a new double-draw bug in #18356 by storing the axes in a flat list instead of an
AxesStackwhich gets rid of duplicates by using a key.I actually don't mind the idea that an axes attaches itself on instantiation - after all they require a
figas a kwarg so it makes sense. However, it would be preferable if both axes classes were consistent, and if it gets added, it should probably be added to theAxesso that all children classes also get it.dopplershift commentedon Aug 27, 2020
👍 to making the two consistent. I'm just not sure what the ramifications are of making
Axesattach itself.jklymak commentedon Aug 28, 2020
Right now
fig.add_axes(ax)only works ifaxwas created viaAxes(fig,...), otherwise it explicitly errors out. So, is there a case where we would create an axes on a figure but not want to also add it to the axes stack?WeatherGod commentedon Aug 28, 2020
jklymak commentedon Aug 28, 2020
I guess you could just add an axes as an artist w/
fig.add_artist(Axes(fig, ...))? I guess if someone wanted it out of the state-based stack (for gca etc) that would be one reason to not enforce a call toadd_axes. Given that possibility I'm leaning towards just removing that call fromAxes3Dand making the user explicitly add all axes...anntzer commentedon Mar 20, 2021
Closed by #19496, afaict.