Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion geoplot/geoplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ def draw(self):
sns.kdeplot(
x=pd.Series([p.x for p in self.df.geometry]),
y=pd.Series([p.y for p in self.df.geometry]),
transform=ccrs.PlateCarree(), ax=ax, **self.kwargs
transform=ccrs.PlateCarree()._as_mpl_transform(ax), ax=ax, **self.kwargs
)
else:
sns.kdeplot(
Expand Down
14 changes: 14 additions & 0 deletions tests/test_geoplot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import geopandas as gpd
import geoplot as gplt
import geoplot.crs as gcrs
import matplotlib.pyplot as plt
import pytest


def test_kdeplot_projection_when_shade_true():
boston_airbnb_listings = gpd.read_file(gplt.datasets.get_path('boston_airbnb_listings'))

ax = gplt.kdeplot(
boston_airbnb_listings, cmap='viridis', projection=gcrs.WebMercator(), figsize=(12, 12),
fill=True
)