w = 0.4
h = 0.3
region = [lon-w, lat-h, lon+w, lat+h]
fig = plt.figure(figsize=(10, 8))
# use cartoee to get a map
ax = cartoee.get_map(image, region=region, vis_params=vis_params)
# add gridlines to the map at a specified interval
cartoee.add_gridlines(ax, interval=[0.2, 0.2], linestyle=":")
# add north arrow
north_arrow_dict = {
"text": "N",
"xy": (0.10, 0.36),
"arrow_length": 0.15,
"text_color": "white",
"arrow_color": "white",
"fontsize": 20,
"width": 5,
"headwidth": 15,
"ha": "center",
"va": "center"
}
cartoee.add_north_arrow(ax, **north_arrow_dict)
# add scale bar
scale_bar_dict = {
'metric_distance': 4,
'unit': "km",
'at_x':(0.05, 0.2),
'at_y':(0.08, 0.11),
'max_stripes': 5,
'ytick_label_margins': 0.25,
'fontsize': 8,
'font_weight': "bold",
'rotation': 0,
'zorder': 999,
'paddings': {"xmin": 0.05, "xmax": 0.05, "ymin": 1.5, "ymax": 0.5},
}
cartoee.add_scale_bar(ax, **scale_bar_dict)
ax.set_title(label = 'Las Vegas, NV', fontsize=15)
plt.show()