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

Error when plotting using matplotlib #1656

Open
JordiBForgeFlow opened this issue Nov 2, 2024 · 0 comments
Open

Error when plotting using matplotlib #1656

JordiBForgeFlow opened this issue Nov 2, 2024 · 0 comments

Comments

@JordiBForgeFlow
Copy link

Prerequisites
Describe the bug

Error
Using neuralprophet > 0.5.4, when attempting to print plots using matplotlib we get an error:
AttributeError: 'None' object has no attribute 'canvas'

This is caused when this line was changed:
https://github.com/ourownstory/neural_prophet/blame/main/neuralprophet/plot_model_parameters_matplotlib.py#L140C15-L140C29

in e27b5b0

fig = fig.tight_layout()

The method tight_layout of matplotlib does not do any return at all. See https://github.com/matplotlib/matplotlib/blob/v3.5.x/lib/matplotlib/figure.py#L3201

To Reproduce
model.set_plotting_backend("matplotlib")
forecast_figure = model.plot(forecast)

Expected behavior

The plots are generated in matplotlib

What actually happens

The call:
fig = fig.tight_layout()

Returns fig = None

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

1 participant