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

docs(matplotlib): update examples to close the plots #355

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

bigfooted
Copy link
Contributor

Two small fixes to the matplotlib example.

The matplotlib example 05_charts/Matplotlib/00_matplotlib-charts.py will replot the figure when you resize the window. When you resize it for a couple of seconds, you will get the message:
~/trame/examples/05_charts/Matplotlib/00_matplotlib-charts.py:45: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (matplotlib.pyplot.figure) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam figure.max_open_warning). Consider using matplotlib.pyplot.close(). fig, ax = plt.subplots(**figure_size())

I just placed a
plt.close('all')
before the fig,ax=plt.subplots() line and I did not get this message anymore.

00_matplotlib-charts.py:118: UserWarning: color is redundantly defined by the 'color' keyword argument and the fmt string "--k" (-> color='k'). The keyword argument will take precedence.
ax.plot(t, x, "--k", lw=3, color="blue")

I removed the "k" from the fmt string

see discussion on: #349

@jourdain jourdain merged commit 1f11e35 into Kitware:master Oct 5, 2023
6 checks passed
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