This script generates a line plot of monthly connections from the years 2016 to 2024.
The data is structured in a dictionary where each key is a year and the value is another dictionary mapping each month to the number of connections. Missing values are filled with None.
The script performs the following steps:
- Imports the necessary library (matplotlib.pyplot).
- Sets up the data in a nested dictionary format.
- Prepares the data for plotting by extracting months and years.
- Initializes the plot with a specified figure size.
- Iterates over each year, extracts the number of connections for each month, and plots the data.
- Customizes the plot with a title, axis labels, legend, rotated x-ticks, and a grid.
- Adjusts the layout to fit all elements neatly.
- Displays the plot.
Usage:
python3 plot.py