Skip to content

Trouble with 3d functionality #369

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

Open
McEnigma24 opened this issue Mar 5, 2025 · 1 comment
Open

Trouble with 3d functionality #369

McEnigma24 opened this issue Mar 5, 2025 · 1 comment

Comments

@McEnigma24
Copy link

Numpy was not working properly, but after putting

pip uninstall numpy
pip install "numpy<2"

it was resolved. You can add this to README

But i got this error after running
./surface
terminate called after throwing an instance of 'std::runtime_error'
what(): No axis
Aborted (core dumped)

Other examples worked except for:
./nonblock
terminate called after throwing an instance of 'std::runtime_error'
what(): Call to subplot() failed.
Aborted (core dumped)

./lines3d
terminate called after throwing an instance of 'std::runtime_error'
what(): No axis
Aborted (core dumped)

3d functionality does not work and with WITHOUT_NUMPY defined it does not even compile

In function ‘int main()’:
surface.cpp:22:10: error: ‘plot_surface’ is not a member of ‘plt’
22 | plt::plot_surface(x, y, z);
| ^~~~~~~~~~~~

@matab99
Copy link

matab99 commented Mar 14, 2025

Since this library appears to be have been unmaintained for quite a while there seem to be a lot of inconsistencies related to which python version you should use. I've tried several different python 3 versions and the only one that seems to work is python 3.8.0. Not only that you need to be mindful which matplotlib/numpy version you install. What did the job for me was installing matplotlib version 3.5.3 using the follwing command:

pip install --force-reinstall -v "matplotlib==3.5.3"

Any higher matplotlib version breaks the library initialization process. The numpy library gets automatically installed along with matplotlib package and seems to work correctly. Also, after reinstalling python and those 2 packages you should apply the patch mentioned in #368.

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