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
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);
| ^~~~~~~~~~~~
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:
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.
Activity
matab99 commentedon 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 whichmatplotlib/numpyversion you install. What did the job for me was installingmatplotlibversion3.5.3using the follwing command:Any higher
matplotlibversion breaks the library initialization process. Thenumpylibrary gets automatically installed along withmatplotlibpackage and seems to work correctly. Also, after reinstalling python and those 2 packages you should apply the patch mentioned in #368.