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

ChartVisualizer not compatible with matplotlib 3.10 #270

Open
nhuet opened this issue Dec 20, 2024 · 1 comment · May be fixed by #271
Open

ChartVisualizer not compatible with matplotlib 3.10 #270

nhuet opened this issue Dec 20, 2024 · 1 comment · May be fixed by #271
Labels
bug Something isn't working

Comments

@nhuet
Copy link

nhuet commented Dec 20, 2024

ChartVisualizer.render() calls internally FigureCanvasAgg.tostring_rgb() which has been removed in matplotlib 3.10. In previous versions it was deprecated and it was proposed to use FigureCanvasAgg.buffer_rgba() instead, maybe this is the solution?

This is a minimal example of code failing with matplotlib 3.10 and pyrddlgym 2.1:

import pyRDDLGym
from pyRDDLGym.core.visualizer.chart import ChartVisualizer

env = pyRDDLGym.make("Cartpole_Continuous_gym", "0")
env.set_visualizer(ChartVisualizer)
env.reset()
img = env.render(to_display=False)
nhuet added a commit to nhuet/scikit-decide that referenced this issue Dec 20, 2024
pyRDDLGym.core.visualizer.chart.render() use a deprecated method which
is even not exising anymore starting from matplotlib==3.10.
And this is used by default when rendering the RDDLDomain wrapping
pyRDDLGym environments.

See issue pyrddlgym-project/pyRDDLGym#270
fteicht pushed a commit to airbus/scikit-decide that referenced this issue Dec 20, 2024
pyRDDLGym.core.visualizer.chart.render() use a deprecated method which
is even not exising anymore starting from matplotlib==3.10.
And this is used by default when rendering the RDDLDomain wrapping
pyRDDLGym environments.

See issue pyrddlgym-project/pyRDDLGym#270
@mike-gimelfarb mike-gimelfarb linked a pull request Dec 21, 2024 that will close this issue
@mike-gimelfarb mike-gimelfarb added the bug Something isn't working label Dec 21, 2024
@mike-gimelfarb
Copy link
Collaborator

I think I have fixed this issue, by switching to the buffering in the io package instead of the matplotlib one. I will need to do a little more testing before I merge though. You are welcome to check out the new PR and let me know if that fixes your problem if you have the time. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants