Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: fix kdeplot to allow use of fill=True after seaborn updates #296

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
)