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

Running demo_no_algo.py out of the box returns NotImplementedError #24

Closed
Chris2L opened this issue Feb 2, 2021 · 4 comments
Closed

Comments

@Chris2L
Copy link

Chris2L commented Feb 2, 2021

Downloaded repo
Opened powershell
ran py -m venv env
ran & env/Scripts/Activate.ps1
ran pip.exe install numpy
ran pip.exe install matplotlib
ran python.exe .\demo_no_algo.py

Got the following error
NotImplementedError: Axes3D currently only supports the aspect argument 'auto'. You passed in 'equal'.

Quick look in code did not show where we set it as equal or where to set it as auto

@Chris2L
Copy link
Author

Chris2L commented Feb 2, 2021

line 201 in sim_data_plot.py had to change to axis = fig.add_subplot(111, projection='3d', aspect='auto')

@dxg-aceinna
Copy link
Collaborator

Hi Chris2L,

Thank you for your feedback.
The reason why I put "equal" there is that I want the XYZ ratio to be 1:1:1 to better represent the trajectory in 3D plot. Back to the time I wrote the code, "equal" is not implemented for "3D" but matplotlib does not rais an error, either. I was hoping this function could be implemented in some version. I seems that matplotlib chose to raise an error instead of implementing this function.
You can check this issue here:
matplotlib/matplotlib#1077

I will see if there is a workaround.

@dxg-aceinna
Copy link
Collaborator

dxg-aceinna commented Feb 3, 2021

Hi Chris2L,

I got a workaround using set_box_aspect. Please refer to: matplotlib/matplotlib#17172.
However, set_box_aspect is not available in older versions of matplotlib. So, I won't fix this until matplotlib has a more decent solution. If you are interested, you can try the following code.

    axis = fig.gca(projection='3d')
    axis.set_box_aspect((1, 1, 1))
    # axis = fig.add_subplot(111, projection='3d', aspect='equal')

@Chris2L
Copy link
Author

Chris2L commented Feb 3, 2021

That works great. Thanks

@Chris2L Chris2L closed this as completed Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants