You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create a plot using data that is not in EPSG:4326. This is necessary since I need to make computations which require a cartesian coordinate system. This MWE returns a blank plot:
import geopandas as gpd
import geoplot as gplt
import matplotlib.pyplot as plt
# read the following dataset using geopandas method: gplt.datasets.get_path('ny_census')
ny = gpd.read_file(gplt.datasets.get_path('ny_census'))
# transform the x,y data into that of a projected CRS
ny_proj = ny.to_crs(32016)
# create a variable for population density
ny_proj['population_density'] = ny_proj['POP2000'] / ny_proj.area
# create a choropleth map of population density
gplt.choropleth(ny_proj, hue = 'POP2000')
plt.show()
# it's blank
This works, however, using the native plot() method:
ny_proj.plot()
plt.show()
I know that I could feed gplt.choropleth() an unprojected geodataframe and then specify the projection argument as something that is projected, but this feels a bit cumbersome and will result in counterintuitive results. E.g., I'd have to attach a variable back to the original ny geodataframe, and if there were units attached to this variable (e.g., meters or feet), these would not match the linear unit of the CRS.
Am I missing something in my geoplot MWE or was it only intended to work with EPSG:4326?
The text was updated successfully, but these errors were encountered:
I'm trying to create a plot using data that is not in EPSG:4326. This is necessary since I need to make computations which require a cartesian coordinate system. This MWE returns a blank plot:
This works, however, using the native
plot()
method:I know that I could feed
gplt.choropleth()
an unprojected geodataframe and then specify the projection argument as something that is projected, but this feels a bit cumbersome and will result in counterintuitive results. E.g., I'd have to attach a variable back to the original ny geodataframe, and if there were units attached to this variable (e.g., meters or feet), these would not match the linear unit of the CRS.Am I missing something in my geoplot MWE or was it only intended to work with EPSG:4326?
The text was updated successfully, but these errors were encountered: