Aan de slagGa gratis aan de slag

Plotting bicycle traffic

Grabbing values out of an array is useful if you only need information about a single element, but to get an overview of the pattern in your data, you need plots! In this exercise, you'll explore how cycling traffic across the Fremont Bridge varies throughout the year by plotting NumPy arrays using matplotlib.

Two NumPy arrays are loaded:

  • daily_riders contains the average number of daily riders for each month in 2016.
  • month contains the corresponding month (1-12) of the year for each element in daily_riders.

Time to plot this data!

Deze oefening maakt deel uit van de cursus

Python for MATLAB Users

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Import pyplot as plt
Code bewerken en uitvoeren