docs(matplotlib): update examples to close the plots #355
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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