Skip to content

Commit

Permalink
Merge pull request #2 from nicholas-ys-tan/issue289
Browse files Browse the repository at this point in the history
BUG: fix kdeplot to allow use of fill=True after seaborn updates
  • Loading branch information
nicholas-ys-tan authored Jun 8, 2024
2 parents 5ca4fab + cba7e2f commit 671581b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
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
)

0 comments on commit 671581b

Please sign in to comment.