Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
madhur-tandon committed Dec 8, 2022
1 parent 5f42c46 commit 4b77b6a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pyscriptjs/src/python/pyscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,20 @@

os.environ["MPLBACKEND"] = "AGG"

import matplotlib.pyplot
import matplotlib.pyplot # noqa: E402

_old_show = matplotlib.pyplot.show
assert _old_show, "matplotlib.pyplot.show"


def show(*, block=None):
buf = io.BytesIO()
matplotlib.pyplot.savefig(buf, format="png")
buf.seek(0)
display(matplotlib.pyplot)
matplotlib.pyplot.clf()


matplotlib.pyplot.show = show

loop = asyncio.get_event_loop()
Expand All @@ -45,7 +48,7 @@ def show(*, block=None):
"_repr_json_": "application/json",
"_repr_javascript_": "application/javascript",
"savefig": "image/png",
"show": "image/png"
"show": "image/png",
}


Expand Down

0 comments on commit 4b77b6a

Please sign in to comment.