The center of the Urban Residents neighborhood
Now you'll find the center point of the urban_poly_3857
and plot it over the polygon.
This exercise is part of the course
Visualizing Geospatial Data in Python
Exercise instructions
- Create
downtown_center
, fromurban_poly_3857
using the GeoSeriescentroid
attribute. - Print the datatype of
downtown_center
. - Plot
urban_poly_3857
as ax usinglightgreen
for the color. - Plot the
downtown_center
, settingax = ax
andcolor = black
. The x-axis ticks are rotated for you. We've included the code to show the plot.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Create downtown_center from urban_poly_3857
downtown_center = urban_poly_3857.____.____
# Print the type of downtown_center
print(type(downtown_center))
# Plot the urban_poly_3857 as ax and add the center point
ax = ____.plot(color = 'lightgreen')
____.plot(ax = ____, color = 'black')
plt.xticks(rotation = 45)
# Show the plot
plt.show()