Skip to content

Conversation

@rjleveque
Copy link
Member

topotools.Topography.make_shoreline_xy makes a contour plot only to extract the contour lines.
Close the figure so it doesn't appear when not wanted in a notebook.

@mandli
Copy link
Member

mandli commented Sep 8, 2025

I was wondering if this was enough, or if fig should also be deleted (it does not with close) and stumbled across these two posts on stack-exchange:

This does make me wonder if there are some areas, especially when animating, that we could possibly improve speed and/or memory footprint drastically by auditing the code and making sure we are consistently using these calls.

@rjleveque
Copy link
Member Author

Yes, I have run into cases when making animations in particular where it runs into memory problems if the figures aren't closed properly. I've never had to delete a figure after closing.

As far as I can see for this PR close is enough, and behaves as desired, so I'll go ahead and merge.

@rjleveque rjleveque merged commit e64d8e5 into clawpack:master Sep 9, 2025
1 check failed
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

Successfully merging this pull request may close these issues.

2 participants