axes1 = fig.gca(projection = '3d')
1 axes1 = fig.add_axes(Axes3D(fig))
2 axes1 = fig.gca(projection=Axes3D.name)
3 axes1 = fig.add_subplot(projection='3d')
These are all the solutions i found during google, the first is the origional type of code, but was unusable after matplotlib 3.4 but the other 3 solution works differently with the first one
it's what I expected:

it's the 1th:

This error happens due to Matplotlib update.
You can use
axes1 = fig.add_subplot(projection = '3d')
instead of
axes1 = fig.gca(projection = '3d')
Reference: Plot 2D data on 3D plot
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With