ComeçarComece de graça

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.

Este exercício faz parte do curso

Visualizing Geospatial Data in Python

Ver curso

Instruções do exercício

  • Create downtown_center, from urban_poly_3857 using the GeoSeries centroid attribute.
  • Print the datatype of downtown_center.
  • Plot urban_poly_3857 as ax using lightgreen for the color.
  • Plot the downtown_center, setting ax = ax and color = black. The x-axis ticks are rotated for you. We've included the code to show the plot.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# 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()
Editar e executar o código