Spaces:
Running
Running
Download plot.py from wwwillchen/mesop: direct link, hf CLI and curl.
- Browser
- Download file 587 Bytes
-
https://huggingface.co/spaces/wwwillchen/mesop/resolve/main/plot.py
- Command line
-
hf download hf://spaces/wwwillchen/mesop/plot.py
-
curl -L -o plot.py https://huggingface.co/spaces/wwwillchen/mesop/resolve/main/plot.py
587 Bytes
| from matplotlib.figure import Figure | |
| import mesop as me | |
| def load(e: me.LoadEvent): | |
| me.set_theme_mode("system") | |
| def app(): | |
| with me.box(style=me.Style(margin=me.Margin.all(15))): | |
| # Create matplotlib figure without using pyplot: | |
| fig = Figure() | |
| ax = fig.subplots() # type: ignore | |
| ax.plot([1, 2]) # type: ignore | |
| me.text("Example using matplotlib:", type="headline-5") | |
| me.plot(fig, style=me.Style(width="100%")) | |