Maps
Here we'll talk about how to plot some maps in DEX using dx
.
Setup
We will be using our own built-in DataFrame generation function for these visualizations. The values you see may be different if you run the same code in a cell, but the column structure should be very similar (if not identical).
The Customized examples with more options do not necessarily represent "good" data visualization; they are just a glimpse into what settings are available to compare against the Simple examples.
Choropleth
Coming soon!
Tilemap
Since dx.random_dataframe()
returns integer_column
values (-100
to 100
) and float_column
values (0.0
to 1.0
) as the only numeric columns by default, we can suggest enabling the lat_float_column
and lon_float_column
arguments for some quick testing:
More about how Noteable builds with Mapbox here. 🗺️
Simple
Make sure you enable dx
as a pandas plotting backend first.
df.plot.tilemap()
directly
Customized
dx.tilemap(
df,
lat='lat_float_column',
lon='lon_float_column',
icon_opacity=0.5,
icon_size='index',
icon_size_scale="log",
stroke_color="magenta",
stroke_width=5,
label_column='bytes_column',
tile_layer="light",
hover_cols=['keyword_column', 'datetime_column'],
)
Make sure you enable dx
as a pandas plotting backend first.
df.plot(
kind='tilemap',
lat='lat_float_column',
lon='lon_float_column',
icon_opacity=0.5,
icon_size='index',
icon_size_scale="log",
stroke_color="magenta",
stroke_width=5,
label_column='bytes_column',
tile_layer="light",
hover_cols=['keyword_column', 'datetime_column'],
)
df.plot.tilemap()
directly