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

Colors, linestyles, and legends

The City of Seattle has meters installed along the Fremont Bridge that log bicycle traffic on both the East and West side of the bridge, which runs North and South.

You're going to use matplotlib to explore how the traffic on the two sides of the bridge change during the day. Understanding how the two sides of the bridge get used during the morning and evening commute is important for any future development into cycling infrastructure that connects to this high traffic route.

Bu egzersiz

Python for MATLAB Users

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

Egzersiz talimatları

  • Plot northbound_traffic in orange and label it "Northbound".
  • Plot southbound_traffic in purple and label it "Southbound".
  • Label the x-axis "Hour of day" and the y-axis "Average number of crossings".
  • Create a legend and show the plot.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Plot the northbound traffic in orange and southbound in purple
plt.plot(____, ____='Northbound', ____='orange')
plt.____

# Label your axes
____('Hour of day')
____('Average number of crossings')

# Create a legend and show the plot
plt.____()
plt.show()
Kodu Düzenle ve Çalıştır