Download app.py from hysts-debug/gradio-plot-render-in-tab: direct link, hf CLI and curl.
- Browser
- Download file 472 Bytes
-
https://huggingface.co/spaces/hysts-debug/gradio-plot-render-in-tab/resolve/main/app.py
- Command line
-
hf download hf://spaces/hysts-debug/gradio-plot-render-in-tab/app.py
-
curl -L -o app.py https://huggingface.co/spaces/hysts-debug/gradio-plot-render-in-tab/resolve/main/app.py
472 Bytes
| #!/usr/bin/env python | |
| import gradio as gr | |
| import numpy as np | |
| import pandas as pd | |
| import plotly.express as px | |
| np.random.seed(0) | |
| df = pd.DataFrame({"x": np.arange(100), "y": np.random.normal(size=100).cumsum()}) | |
| fig = px.line(df, x="x", y="y") | |
| with gr.Blocks() as demo: | |
| with gr.Tabs(): | |
| with gr.Tab(label="a"): | |
| gr.Plot(value=fig) | |
| with gr.Tab(label="b"): | |
| gr.Plot(value=fig) | |
| if __name__ == "__main__": | |
| demo.queue().launch() | |