Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9359d45

Browse files
committed
documentation for hexbin_mapbox
1 parent 0057a14 commit 9359d45

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/python/plotly-express.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,17 @@ fig = px.line_mapbox(df, lat="centroid_lat", lon="centroid_lon", color="peak_hou
340340
fig.show()
341341
```
342342

343+
```python
344+
import plotly.express as px
345+
import numpy as np
346+
px.set_mapbox_access_token(open(".mapbox_token").read())
347+
df = px.data.carshare()
348+
fig = px.hexbin_mapbox(df, lat="centroid_lat", lon="centroid_lon", color="peak_hour",
349+
color_continuous_scale=px.colors.cyclical.IceFire, labels={"color": "Average peak hour"},
350+
gridsize=10, agg_func=np.mean)
351+
fig.show()
352+
```
353+
343354
```python
344355
import plotly.express as px
345356
df = px.data.gapminder()

0 commit comments

Comments
 (0)