4

I'm trying to plot a bunch of points on a map of Britain and Ireland, and I've been using GeoPandas for that.

I've basically just been following the tutorials to do that, and slicing a world map with a Mercator projection such that it only shows Great Britain and Ireland. But somehow the aspect ratio (projection) ends up distorted.

Here's what my squashed map looks like now:

My squashed map

Here's what I've tried:

  • Setting the figsize attribute to something with a larger height
  • Assigning a different CRS
  • Using a different plotting engine altogether (I can't seem to get Altair to work)

My plot as it stands, with the geopandas code used to generate it, is here on GitHub.

What am I doing wrong, and how do I unsquash this map?

3
  • 1
    You can convert to another CRS with to_crs. When using a local CRS for the UK, you should get a better result.
    – joris
    May 10 '19 at 16:07
  • 1
    Ah, I see. I had to do that after slicing it. It looks good now: github.com/open-editions/corpus-joyce-portrait-TEI/blob/master/…
    – Jonathan
    May 10 '19 at 16:43
  • @joris please convert your comment into an answer so this thread can be marked as answered
    – underdark
    May 11 '19 at 16:56
3

The reason it looks squashed like that is because GeoPandas naively plots the longitude and latitude with an equal aspect ratio.

To have a more realistic result, you can convert your data to a local CRS for the UK, using the to_crs method.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.