-
Notifications
You must be signed in to change notification settings - Fork 1
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
Crashes on example code #3
Comments
@AgainPsychoX Hi thanks for trying the package. I guess you installed with pip. The version published was an old one. This is my fault. Can you try to upgrade the package ?
|
This seems to work now. For other people: if you find this code not working with the correct version, try recreating your virtualenv and reinstalling packages from |
I confirm it works. Sorry for late response, I wasn't much interested in my project for a while, but today I wanted to check out few my old projects and decided to revisit this thing. In my code currently I have something like: if USE_PYGAME_MATPLOTLIB_BACKEND:
matplotlib.use('module://pygame_matplotlib.backend_pygame')
else:
matplotlib.use('Agg') and in the loop: if USE_PYGAME_MATPLOTLIB_BACKEND:
fig.canvas.draw()
surf = fig
else: # `matplotlib.backends.backend_agg` based solution
canvas = agg.FigureCanvasAgg(fig)
buffer, w_h = canvas.print_to_buffer()
surf = pygame.image.frombuffer(buffer, w_h, "RGBA") The There still are some issues with the library:
Using The game state on above screenshots is a bit different as I needed to restart the app to change the values. Here is link to full source code if you are interested: https://github.com/AgainPsychoX/FuzzyLogicRacingGame |
@AgainPsychoX Thanks that is quite a good example how the package could be improved. Maybe if I find some time, I will try to make your example render "better" . For the performance, I am not sure I would be able to do a lot, but it is also good to know how the package performs. |
My code:
Log:
Other example (using
fig.canvas.draw()
) also crashes with very similar result.The text was updated successfully, but these errors were encountered: