Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue on page /tutorials/W0D3_LinearAlgebra/student/W0D3_Tutorial1.html #110

Closed
gmatharu opened this issue Jun 13, 2022 · 1 comment
Closed
Labels
Code-update Version issue and/or update code to current versions

Comments

@gmatharu
Copy link

Well its not an issue with the content itself, rather seems like a bug from matplotlib .

The issue is in Section Think! 2.1: Determing dependence, while plotting vectors in 3-D.:

    424                 """
    425                 try:
--> 426                     signature = inspect.signature(artist.do_3d_projection)
    427                     signature.bind()
    428                 # ValueError if `inspect.signature` cannot provide a signature

AttributeError: 'Arrow3D' object has no attribute 'do_3d_projection' 

It seems like matplotlib removed the method do_3d_projection and requires us to implement it. The discussion could be found here:

matplotlib/matplotlib#21688

I tested it in Kaggle and it works, basically you need to add this method as below to the Arrow3D class:

class Arrow3D(FancyArrowPatch):
    def __init__(self, xs, ys, zs, *args, **kwargs):
        FancyArrowPatch.__init__(self, (0,0), (0,0), *args, **kwargs)
        self._verts3d = xs, ys, zs

    def draw(self, renderer):
        xs3d, ys3d, zs3d = self._verts3d
        xs, ys, zs = proj3d.proj_transform(xs3d, ys3d, zs3d, renderer.M)
        self.set_positions((xs[0],ys[0]),(xs[1],ys[1]))
        FancyArrowPatch.draw(self, renderer)
    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)
@spirosChv
Copy link
Contributor

resolved in #42

@spirosChv spirosChv transferred this issue from NeuromatchAcademy/course-content Jul 6, 2023
@spirosChv spirosChv added the Code-update Version issue and/or update code to current versions label Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code-update Version issue and/or update code to current versions
Projects
None yet
Development

No branches or pull requests

2 participants