import plotly.express as px
import plotly.io as pio
= "plotly_mimetype+notebook_connected" pio.renderers.default
Quarto Computations
= px.data.iris()
df display(df.head())
sepal_length | sepal_width | petal_length | petal_width | species | species_id | |
---|---|---|---|---|---|---|
0 | 5.1 | 3.5 | 1.4 | 0.2 | setosa | 1 |
1 | 4.9 | 3.0 | 1.4 | 0.2 | setosa | 1 |
2 | 4.7 | 3.2 | 1.3 | 0.2 | setosa | 1 |
3 | 4.6 | 3.1 | 1.5 | 0.2 | setosa | 1 |
4 | 5.0 | 3.6 | 1.4 | 0.2 | setosa | 1 |
= px.scatter(df, x="sepal_width", y="sepal_length")
fig_a fig_a.show()
= px.data.gapminder()
gapminder = gapminder.query("year == 2007")
gapminder2007 = px.scatter(
fig
gapminder2007,="gdpPercap", y="lifeExp", color="continent",
x="pop", size_max=60,
size="country")
hover_name fig.show()