Skip to content

Commit a804238

Browse files
committed
added px example
1 parent 8c571ad commit a804238

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

notebooks/bubble-maps.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,33 @@ jupyter:
3636
v4upgrade: true
3737
---
3838

39+
### Bubble map with plotly express
40+
41+
Plotly express functions take as argument a tidy [pandas DataFrame](https://pandas.pydata.org/pandas-docs/stable/getting_started/10min.html). With ``px.scatter_geo``, each line of the dataframe is represented as a marker point. The column set as the `size` argument gives the size of markers.
42+
43+
```python
44+
import plotly.express as px
45+
gapminder = px.data.gapminder().query("year==2007")
46+
fig = px.scatter_geo(gapminder, locations="iso_alpha", color="continent",
47+
hover_name="country", size="pop",
48+
projection="natural earth")
49+
fig.show()
50+
```
51+
52+
### Bubble Map with animation
53+
54+
```python
55+
import plotly.express as px
56+
gapminder = px.data.gapminder()
57+
fig = px.scatter_geo(gapminder, locations="iso_alpha", color="continent",
58+
hover_name="country", size="pop",
59+
animation_frame="year",
60+
projection="natural earth")
61+
fig.show()
62+
```
63+
64+
### Bubble Map with go.Scattergeo
65+
3966
#### United States Bubble Map
4067

4168
Note about `sizeref`:

0 commit comments

Comments
 (0)