Skip to content
Prev Previous commit
Next Next commit
documentation for hexbin_mapbox
  • Loading branch information
RenaudLN committed Jun 11, 2020
commit 9359d457cf60f01766f2d5f08d13dfb3b3b51fdb
11 changes: 11 additions & 0 deletions doc/python/plotly-express.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,17 @@ fig = px.line_mapbox(df, lat="centroid_lat", lon="centroid_lon", color="peak_hou
fig.show()
```

```python
import plotly.express as px
import numpy as np
px.set_mapbox_access_token(open(".mapbox_token").read())
df = px.data.carshare()
fig = px.hexbin_mapbox(df, lat="centroid_lat", lon="centroid_lon", color="peak_hour",
color_continuous_scale=px.colors.cyclical.IceFire, labels={"color": "Average peak hour"},
gridsize=10, agg_func=np.mean)
fig.show()
```

```python
import plotly.express as px
df = px.data.gapminder()
Expand Down