Skip to content

Trouble with 3d functionality #369

Open

Description

@McEnigma24

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);
| ^~~~~~~~~~~~

Activity

  1. matab99 commented on Mar 14, 2025

    @matab99

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions