lets_plot.coord_map#

lets_plot.coord_map(xlim=None, ylim=None, flip=False)#

Project a portion of the earth, which is approximately spherical, onto a flat 2D plane. Map projections generally do not preserve straight lines, so this requires considerable computation.

Parameters:
xlimlist

Limits (2 elements) for the x axis. 1st element defines lower limit, 2nd element defines upper limit. None means no lower / upper bound - depending on the index in list.

ylimlist

Limits (2 elements) for the y axis. 1st element defines lower limit, 2nd element defines upper limit. None means no lower / upper bound - depending on the index in list.

flipbool

Flip the coordinate system axis so that horizontal axis becomes vertical and vice versa.

Returns:
FeatureSpec

Coordinate system specification.

Examples

1from lets_plot import *
2from lets_plot.geo_data import *
3LetsPlot.setup_html()
4us = geocode_states('US-48').get_boundaries(4)
5ggplot() + geom_map(map=us, fill='gray', color='white') + \
6    coord_map(xlim=(-130, -100))
The geodata is provided by © OpenStreetMap contributors and is made available here under the Open Database License (ODbL).