-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
Running the current version of Cell2Fire(0.2) with Python (3.11.10) and matplotlib=3.10.1 on MacOS 15.4 results in an error.
Description
Calling GlobalFireSpreadEvo() results in a TypeError:
TypeError: FigureCanvasAgg.print_png() got an unexpected keyword argument ‘figsize’
Cause
This happens because figsize is passed to plt.savefig(), but it is not a valid keyword argument there. figsize should be passed when creating the figure using plt.figure(figsize=(...)).
This was deprecated for matplotlib>3.6, see here.
Here are some examples where this happens:
Line 303 in 544c83c
| plt.savefig(PathFile, dpi=200, figsize=(200, 200), bbox_inches='tight', transparent=True) |
Fix
- either fix matplotlib in requirements file to
matplotlib<3.6 - or (recommended)
# Replace these:
plt.savefig("output.png", figsize=(10, 6), dpi=300)
# With:
plt.figure(figsize=(10, 6))
...
plt.savefig("output.png", dpi=300)Metadata
Metadata
Assignees
Labels
No labels