extrinsic2pyramid icon indicating copy to clipboard operation
extrinsic2pyramid copied to clipboard

TypeError: FigureBase.gca() got an unexpected keyword argument 'projection'

Open khayamgondal opened this issue 1 year ago • 2 comments

Seeing following error:

matplotlib==3.7.2
matplotlib-inline==0.1.6
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[2], line 3
      1 from util.camera_pose_visualizer import CameraPoseVisualizer
----> 3 visualizer = CameraPoseVisualizer([-50, 50], [-50, 50], [0, 100])

File /workspace/notebooks/capture-notebooks/old_notebooks/khayam/extrinsic2pyramid/util/camera_pose_visualizer.py:10, in CameraPoseVisualizer.__init__(self, xlim, ylim, zlim)
      8 def __init__(self, xlim, ylim, zlim):
      9     self.fig = plt.figure(figsize=(18, 7))
---> 10     self.ax = self.fig.gca(projection='3d')
     11     self.ax.set_aspect("auto")
     12     self.ax.set_xlim(xlim)

TypeError: FigureBase.gca() got an unexpected keyword argument 'projection'
<Figure size 1800x700 with 0 Axes>


khayamgondal avatar Oct 24 '23 16:10 khayamgondal

i got the same error

verdureB avatar Jan 19 '24 06:01 verdureB

Change the line as follows:

self.ax = self.fig.add_subplot(projection='3d')

TabassumNova avatar Jan 22 '24 18:01 TabassumNova