【Python】スライダーによるグラフの変更【Plotly Express】
import plotly.express as px
df = px.data.gapminder()
fig = px.scatter(
df,
x="gdpPercap", y="lifeExp",
animation_frame="year", animation_group="country",
size="pop",
color="continent",
color_discrete_sequence=px.colors.sequential.Jet, # px.colors.sequential.Inferno, # px.colors.qualitative.Antique,
hover_name="country",
log_x=True,
size_max=55,
range_x=[100,100000], range_y=[25,90]
)
fig["layout"].pop("updatemenus") # optional, drop animation buttons
fig.show()広告を取得中...
