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
Good day and thanks for your work.
I'm trying to run the demo2.py to get the rotating 3d image, and the image window does appear
with the axes, but no drawing of the rotating figure.
I'm getting a traceback:
Exception in Tkinter callback
Traceback (most recent call last):
File "c:\bin\python38\lib\tkinter_init_.py", line 1883, in call
return self.func(*args)
File "c:\bin\python38\lib\tkinter_init_.py", line 804, in callit
func(*args)
File "c:\bin\python38\lib\site-packages\matplotlib\backends_backend_tk.py", line 253, in idle_draw
self.draw()
File "c:\bin\python38\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 9, in draw
super(FigureCanvasTkAgg, self).draw()
File "c:\bin\python38\lib\site-packages\matplotlib\backends\backend_agg.py", line 407, in draw
self.figure.draw(self.renderer)
File "c:\bin\python38\lib\site-packages\matplotlib\artist.py", line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "c:\bin\python38\lib\site-packages\matplotlib\figure.py", line 1870, in draw
self.canvas.draw_event(renderer)
File "c:\bin\python38\lib\site-packages\matplotlib\backend_bases.py", line 1759, in draw_event
self.callbacks.process(s, event)
File "c:\bin\python38\lib\site-packages\matplotlib\cbook_init_.py", line 229, in process
self.exception_handler(exc)
File "c:\bin\python38\lib\site-packages\matplotlib\cbook_init_.py", line 81, in exception_printer
raise exc
File "c:\bin\python38\lib\site-packages\matplotlib\cbook_init.py", line 224, in process
func(*args, **kwargs)
File "c:\bin\python38\lib\site-packages\matplotlib\animation.py", line 975, in _start
self._init_draw()
File "c:\bin\python38\lib\site-packages\matplotlib\animation.py", line 1722, in _init_draw
self._drawn_artists = self._init_func()
File "demo2-new.py", line 89, in init
line.set_3d_properties([])
File "c:\bin\python38\lib\site-packages\mpl_toolkits\mplot3d\art3d.py", line 143, in set_3d_properties
zs = np.broadcast_to(zs, xs.shape)
AttributeError: 'list' object has no attribute 'shape'
IF anyone else runs into this, it can be fixed by wrapping both the x and y data in the set_data statements with np.array. Change these two lines to the following:
currently on line 80 in def init():
line.set_data(np.array([]), np.array([]))
currently on line 98 in def animate(i):
line.set_data(np.array([start[0], end[0]]), np.array([start[1], end[1]]))
Good day and thanks for your work.
I'm trying to run the demo2.py to get the rotating 3d image, and the image window does appear
with the axes, but no drawing of the rotating figure.
I'm getting a traceback:
Exception in Tkinter callback
Traceback (most recent call last):
File "c:\bin\python38\lib\tkinter_init_.py", line 1883, in call
return self.func(*args)
File "c:\bin\python38\lib\tkinter_init_.py", line 804, in callit
func(*args)
File "c:\bin\python38\lib\site-packages\matplotlib\backends_backend_tk.py", line 253, in idle_draw
self.draw()
File "c:\bin\python38\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 9, in draw
super(FigureCanvasTkAgg, self).draw()
File "c:\bin\python38\lib\site-packages\matplotlib\backends\backend_agg.py", line 407, in draw
self.figure.draw(self.renderer)
File "c:\bin\python38\lib\site-packages\matplotlib\artist.py", line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "c:\bin\python38\lib\site-packages\matplotlib\figure.py", line 1870, in draw
self.canvas.draw_event(renderer)
File "c:\bin\python38\lib\site-packages\matplotlib\backend_bases.py", line 1759, in draw_event
self.callbacks.process(s, event)
File "c:\bin\python38\lib\site-packages\matplotlib\cbook_init_.py", line 229, in process
self.exception_handler(exc)
File "c:\bin\python38\lib\site-packages\matplotlib\cbook_init_.py", line 81, in exception_printer
raise exc
File "c:\bin\python38\lib\site-packages\matplotlib\cbook_init.py", line 224, in process
func(*args, **kwargs)
File "c:\bin\python38\lib\site-packages\matplotlib\animation.py", line 975, in _start
self._init_draw()
File "c:\bin\python38\lib\site-packages\matplotlib\animation.py", line 1722, in _init_draw
self._drawn_artists = self._init_func()
File "demo2-new.py", line 89, in init
line.set_3d_properties([])
File "c:\bin\python38\lib\site-packages\mpl_toolkits\mplot3d\art3d.py", line 143, in set_3d_properties
zs = np.broadcast_to(zs, xs.shape)
AttributeError: 'list' object has no attribute 'shape'
Windows 10
Python: 3.8.6
matplotlib: 3.3.4
numpy: 1.20.1
pyquaternion: 0.9.9
I found one post on stackoverflow that says to use numpy.array, but you're doing that already.
Thank you again.......
Tom C.
The text was updated successfully, but these errors were encountered: