<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Plotting with Geoplot and GeoPandas
Geoplot &lt;https
Step1:  Plotting with Geoplot
We start out by replicating the basic GeoPandas world plot using Geoplot.
Step2:  Geoplot can re-project data into any of the map projections provided by
CartoPy (see the list
here &lt;http
Step3:  If you want to use size as a visual variable, you want a cartogram. Here
are population estimates for countries in Africa.
Step4:  If we have data in the shape of points in space, we may generate a
three-dimensional heatmap on it using kdeplot. This example also
demonstrates how easy it is to stack plots on top of one another.
<ASSISTANT_TASK:>
Python Code:
import geopandas
path = geopandas.datasets.get_path('naturalearth_lowres')
df = geopandas.read_file(path)
# Add a column we'll use later
df['gdp_pp'] = df['gdp_md_est'] / df['pop_est']
boroughs = geopandas.read_file(geopandas.datasets.get_path('nybb')).to_crs(epsg='4326')
injurious_collisions = geopandas.read_file(
    "https://github.com/ResidentMario/geoplot-data/raw/master/nyc-injurious-collisions.geojson")
Explanation: Plotting with Geoplot and GeoPandas
Geoplot &lt;https://residentmario.github.io/geoplot/index.html&gt; is a Python
library providing a selection of easy-to-use geospatial visualizations. It is
built on top of the lower-level CartoPy &lt;http://scitools.org.uk/cartopy/&gt;,
covered in a separate section of this tutorial, and is designed to work with
GeoPandas input.
This example is a brief tour of the geoplot API. For more details on the
library refer to its documentation
&lt;https://residentmario.github.io/geoplot/index.html&gt;_.
First we'll load in the data using GeoPandas.
End of explanation
import geoplot
geoplot.polyplot(df, figsize=(8, 4))
Explanation: Plotting with Geoplot
We start out by replicating the basic GeoPandas world plot using Geoplot.
End of explanation
geoplot.choropleth(df, hue='gdp_pp', cmap='Greens', figsize=(8, 4))
Explanation: Geoplot can re-project data into any of the map projections provided by
CartoPy (see the list
here &lt;http://scitools.org.uk/cartopy/docs/latest/crs/projections.html&gt;_).
polyplot is trivial and can only plot the geometries you pass to it. If
you want to use color as a visual variable, specify a choropleth. Here
we sort GDP per person by country into five buckets by color.
End of explanation
geoplot.cartogram(df[df['continent'] == 'Africa'],
                  scale='pop_est', limits=(0.2, 1), figsize=(7, 8))
Explanation: If you want to use size as a visual variable, you want a cartogram. Here
are population estimates for countries in Africa.
End of explanation
ax = geoplot.kdeplot(injurious_collisions.sample(1000),
                     shade=True, shade_lowest=False,
                     clip=boroughs.geometry)
geoplot.polyplot(boroughs, ax=ax)
Explanation: If we have data in the shape of points in space, we may generate a
three-dimensional heatmap on it using kdeplot. This example also
demonstrates how easy it is to stack plots on top of one another.
End of explanation
<END_TASK>