Closed EmmetZ closed 10 months ago
I try to run code/scales-projections/projection-3d-frame.py and then there's an error: AttributeError: 'Arrow3D' object has no attribute 'do_3d_projection'
code/scales-projections/projection-3d-frame.py
AttributeError: 'Arrow3D' object has no attribute 'do_3d_projection'
my env: python: 3.11, matplotlib: 3.8.0
then I found a possible solution here -> matplotlib issues#21688 when I change class Arrow3D to :
Arrow3D
class Arrow3D(mpatches.FancyArrowPatch): def __init__(self, xs, ys, zs, *args, **kwargs): mpatches.FancyArrowPatch.__init__(self, (0, 0), (0, 0), *args, **kwargs) self._verts3d = xs, ys, zs def do_3d_projection(self, renderer=None): xs3d, ys3d, zs3d = self._verts3d xs, ys, zs = proj3d.proj_transform(xs3d, ys3d, zs3d, self.axes.M) self.set_positions((xs[0],ys[0]),(xs[1],ys[1])) return np.min(zs)
it works, so I think maybe projection-3d-frame.py need to be updated?
projection-3d-frame.py
Thanks and yes. Can you make a PR?
I have already made a PR(I hope I got it right), thanks for your wonderful book!
Merge, thanks for your contribution.
I try to run
code/scales-projections/projection-3d-frame.py
and then there's an error:AttributeError: 'Arrow3D' object has no attribute 'do_3d_projection'
my env: python: 3.11, matplotlib: 3.8.0
then I found a possible solution here -> matplotlib issues#21688 when I change class
Arrow3D
to :it works, so I think maybe
projection-3d-frame.py
need to be updated?