question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add geom_map geometry for plotting geographic maps

See original GitHub issue

ggplot2 has geom_map for plotting geography. I can imagine a nice interface with geopandas, which has gpd.GeoDataFrame.plot() through matplotlib. Here’s a demo from the docs:

  ggplot(crimesm, aes(map_id = state)) +
    geom_map(aes(fill = value), map = states_map) +
    expand_limits(x = states_map$long, y = states_map$lat) +
    facet_wrap( ~ variable)

geom_map-8

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
has2k1commented, Jun 15, 2017

I am working on a mapping geom (geom_carto), with geopandas and cartopy. Using cartopy as the backend though feature rich (real cartographic projections), is not straight-forward and there are changes I would want in cartopy.

I hoped to have it for the next minor release, though if I cannot tame cartopy in time, I may in the meanwhile create an alternative projection-less mapping geom just like geom_map.

0reactions
has2k1commented, Jun 4, 2018

@cwerner

geom_carto depends on cartopy acquiring a standard way to add artists, e.g. GeomCollection as suggested.

I have not looked into xarray, so my imagination on how to use it as a datasource it is blank.

Read more comments on GitHub >

github_iconTop Results From Across the Web

plotnine.geoms.geom_map
Create map by placing the features in layers in an order that limits obstraction. The GeoDataFrame.geometry.centroid property has the center coordinates of ...
Read more >
Geospatial Map Visualizations in R - YouTube
If you are explaining data related to geography or just want to visualize by latitude / longitude location, you need to know #ggplot2...
Read more >
6 Maps - ggplot2: Elegant Graphics for Data Analysis
6 Maps. Plotting geospatial data is a common visualisation task, and one that requires specialised tools. Typically the problem can be decomposed into...
Read more >
Polygons from a reference map — geom_map • ggplot2
aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping...
Read more >
Drawing beautiful maps programmatically with R, sf and ggplot2
To continue adding to the map, state data is directly plotted as an additional sf layer using geom_sf . In addition, state names...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found