gradio/demo/scatterplot_component/run.py
aliabid94 d1cfe1e9de
Allow plot tooltip to show extra columns (#9800)
* changes

* add changeset

* changes

* changes

* chanes

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-11-01 19:00:22 -07:00

21 lines
425 B
Python

import gradio as gr
from vega_datasets import data
cars = data.cars()
with gr.Blocks() as demo:
gr.ScatterPlot(
value=cars,
x="Horsepower",
y="Miles_per_Gallon",
color="Origin",
tooltip=["Name"],
title="Car Data",
y_title="Miles per Gallon",
color_legend_title="Origin of Car",
container=False,
)
if __name__ == "__main__":
demo.launch()