BaşlayınÜcretsiz Başlayın

Modifying a scatterplot

In the previous exercise, we created a scatter plot to show Freddy Frequentist's cell phone data.

In this exercise, we've done some magic so that the plot will appear over a map of our town. If we just plot the data as we did before, we won't be able to see the map or pick out the areas with the most points. We can fix this by changing the colors, markers, and transparency of the scatter plot.

As before, the matplotlib.pyplot module has been imported under the alias plt, and the cellphone data is in the DataFrame cellphone.

Bu egzersiz

Introduction to Data Science in Python

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Change the marker color to red
plt.scatter(cellphone.x, cellphone.y,
           ____=____)

# Add labels
plt.ylabel('Latitude')
plt.xlabel('Longitude')

# Display the plot
plt.show()
Kodu Düzenle ve Çalıştır