File size: 472 Bytes
60c7b25 ca9ca0f 60c7b25 ca9ca0f 60c7b25 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
#!/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()
|