Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 76010e6

Browse filesBrowse files
fixing up docs
1 parent b79333a commit 76010e6
Copy full SHA for 76010e6

File tree

Expand file treeCollapse file tree

1 file changed

+12
-9
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-9
lines changed

‎doc/python/hexbin-mapbox.md

Copy file name to clipboardExpand all lines: doc/python/hexbin-mapbox.md
+12-9Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jupyter:
66
extension: .md
77
format_name: markdown
88
format_version: '1.2'
9-
jupytext_version: 1.5.1
9+
jupytext_version: 1.4.2
1010
kernelspec:
1111
display_name: Python 3
1212
language: python
@@ -20,14 +20,14 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.7.4
23+
version: 3.7.7
2424
plotly:
2525
description: How to make a map with Hexagonal Binning of data in Python with Plotly.
26-
display_as: scientific
26+
display_as: maps
2727
language: python
2828
layout: base
2929
name: Hexbin Mapbox
30-
order: 7
30+
order: 13
3131
page_type: u-guide
3232
permalink: python/hexbin-mapbox/
3333
redirect_from: python/hexbin-mapbox/
@@ -55,7 +55,7 @@ fig.update_layout(margin=dict(b=0, t=0, l=0, r=0))
5555
fig.show()
5656
```
5757

58-
#### Count Hexbin with Minimum Count
58+
#### Count Hexbin with Minimum Count and Opacity
5959

6060
```python
6161
import plotly.figure_factory as ff
@@ -66,13 +66,13 @@ df = px.data.carshare()
6666

6767
fig = ff.create_hexbin_mapbox(
6868
data_frame=df, lat="centroid_lat", lon="centroid_lon",
69-
nx_hexagon=10, opacity=0.9, labels={"color": "Point Count"},
69+
nx_hexagon=10, opacity=0.5, labels={"color": "Point Count"},
7070
min_count=1,
7171
)
7272
fig.show()
7373
```
7474

75-
#### Display the Underlying Data
75+
#### Display the Underlying Data
7676

7777
```python
7878
import plotly.figure_factory as ff
@@ -83,7 +83,7 @@ df = px.data.carshare()
8383

8484
fig = ff.create_hexbin_mapbox(
8585
data_frame=df, lat="centroid_lat", lon="centroid_lon",
86-
nx_hexagon=10, opacity=0.9, labels={"color": "Point Count"},
86+
nx_hexagon=10, opacity=0.5, labels={"color": "Point Count"},
8787
min_count=1, color_continuous_scale="Viridis",
8888
show_original_data=True,
8989
original_data_marker=dict(size=4, opacity=0.6, color="deeppink")
@@ -96,6 +96,7 @@ fig.show()
9696
```python
9797
import plotly.figure_factory as ff
9898
import plotly.express as px
99+
import numpy as np
99100

100101
px.set_mapbox_access_token(open(".mapbox_token").read())
101102
df = px.data.carshare()
@@ -113,6 +114,7 @@ fig.show()
113114
```python
114115
import plotly.figure_factory as ff
115116
import plotly.express as px
117+
import numpy as np
116118

117119
px.set_mapbox_access_token(open(".mapbox_token").read())
118120
df = px.data.carshare()
@@ -138,7 +140,7 @@ np.random.seed(0)
138140
N = 500
139141
n_frames = 12
140142
lat = np.concatenate([
141-
np.random.randn(N) * 0.5 + np.cos(i / n_frames * 2 * np.pi)
143+
np.random.randn(N) * 0.5 + np.cos(i / n_frames * 2 * np.pi) + 10
142144
for i in range(n_frames)
143145
])
144146
lon = np.concatenate([
@@ -152,6 +154,7 @@ frame = np.concatenate([
152154
fig = ff.create_hexbin_mapbox(
153155
lat=lat, lon=lon, nx_hexagon=15, animation_frame=frame,
154156
color_continuous_scale="Cividis", labels={"color": "Point Count", "frame": "Period"},
157+
opacity=0.5, min_count=1,
155158
show_original_data=True, original_data_marker=dict(opacity=0.6, size=4, color="deeppink")
156159
)
157160
fig.update_layout(margin=dict(b=0, t=0, l=0, r=0))

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.