Modifying an AxesSubplot to be 3D in the context of plt.subplot_mosaic

Hello! long time fan, first time discourser!

I’m currently in a situation where I want to make use of the nice plt.subplot_mosaic function, but want to specify that one of the plots should be 3D. The only way to add a 3D plot to the axes seems to be fig.add_subplot(projection = '3d'), but I was wondering if one could also just manually do something like axs["foo"] = Axes3DSubplot(bar) or something equivalent?

Thanks :slight_smile:

Yep, you can destroy and then overwrite since axs is a regular python dictionary of axes. Something like:

  axs['foo'] =  plt.subplot(2,3,3, projection='3d')

where 2,3,3 is the #row, #col, loc specification, or you can pass in the subplot spec if the 3D axes spans multiple rows/columns.