Introductie tot datavisualisatie met Plotly in Python
Alex Scriven
Data Scientist
$$
| spec | av_flip_length |
|---|---|
| Adelie | 189.953642 |
| Chinstrap | 195.823529 |
| Gentoo | 217.186992 |
spec en av_flip_length$$
fig = px.bar(penguin_flippers,
x="spec",
y="av_flip_length")
fig.show()

plotly-‘shortcut’-functies:fig.update_xaxes(title_text="Species")
fig.update_yaxes(title_text="Average Flipper Length")
$$
update_layout()fig.update_layout(dict(
xaxis=dict(title=dict(text="Species")),
yaxis=dict(title=dict(text="Average Flipper Length"))
))

$$
update_layout() voor meer controle:$$
$$
Meer info in de Plotly-documentatie

fig.update_layout(dict(
yaxis=dict(range=[150, penguin_flippers["av_flip_length"].max() + 30]
)))

Wat als sommige datapunten veel groter zijn dan andere?

fig = px.bar(billionaire_data,
x="Country",
y="Number Billionaires")
fig.show()


$$
log_y en log_x-argumentenfig = px.bar(billionaire_data,
x="Country",
y="Number Billionaires",
log_y=True)
fig.show()
$$

💡 Houd altijd je publiek in gedachten bij het kiezen van een visualisatie

Introductie tot datavisualisatie met Plotly in Python