Skip to content

Commit 413ae76

Browse files
authored
Close matplotlib graph ... (#206)
before starting to format a new graph. In matplotlib 3.9.1 this was causing graphs to get overlaid.
1 parent 16a3f51 commit 413ae76

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mathics_django/web/format.py

+4
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,10 @@ def format_graph(G) -> str:
437437
global node_size
438438
global cached_pair
439439

440+
# Make sure we close any previous graph before starting to create
441+
# new graph.
442+
pyplot.close()
443+
440444
pyplot.switch_backend("AGG")
441445
cached_pair = None
442446

0 commit comments

Comments
 (0)