import gradio as gr import pandas as pd data=pd.DataFrame({ 'x': [1, 2, 3, 4, 5, 6, 7, 8], 'y': [2.5, 3.1, 4.7, 3.8, 5.5, 6.8, 7.9, 8.2], }) plot=gr.ScatterPlot( value=data, x='x', y='y', title='練習次數與平均成績的關係', x_title='練習次數', y_title='平均成績(0~10)', interactive=True ) iface=gr.Interface( fn=lambda: data, inputs=[], outputs=plot, title='分佈圖 ScatterPlot() 測試', flagging_mode='never', ) iface.launch()