-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
I have been getting this UserWarning from matplotlib and VisClaw lately:
clawpack/visclaw/src/python/visclaw/frametools.py:171: UserWarning: Ignoring specified arguments in this call because figure with num: 1006 already exists
plotfigure._handle = plt.figure(num=figno, **plotfigure.kwargs)It may be occurring due to a change in matplotlib, but I think there is a larger problem that needs to be addressed. The addition of key-word arguments is the cause of the problem, and can be recreated by
import matplotlib.pyplot as plt
plt.figure(num=1)
plt.figure(num=1, **{'figsize': (6.4, 4.8)})I see two fixes for this:
- close (delete) the figure and create a new one, or
- see if the figure exists and do not apply the key-word arguments (or maybe we do).
The first is probably the safest but the positions and sizes of windows may not be maintained during interactive plotting. The second would not allow key-word arguments to be re-applied but would maintain the state. Probably bears some testing to fix this.
Versions for reference:
Python 3.13.2
matplotlib.version = '3.10.0'
Metadata
Metadata
Assignees
Labels
No labels