Skip to content

Commit

Permalink
Close matplotlib graph ...
Browse files Browse the repository at this point in the history
before starting to format a new graph.

In matplotlib 3.9.1 this was causing graphs to get overlaid.
  • Loading branch information
rocky committed Aug 4, 2024
1 parent 3bf1275 commit 8588fca
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mathics_django/web/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ def format_graph(G) -> str:
global node_size
global cached_pair

# Make sure we close any previous graph before starting to create
# new graph.
pyplot.close()

pyplot.switch_backend("AGG")
cached_pair = None

Expand Down

0 comments on commit 8588fca

Please sign in to comment.