# Imports from matplotlib import pyplot as plt import pandas as pd # Load the data data = pd.read_csv('series-161224_2.csv') # Define the start and end index for your data range start = 0 end = 120 # Slice the data for x and y x = data['Title'][start:end] y = data['Gross Domestic Product: Quarter on Quarter growth: CVM SA %'][start:end] # Create a figure with custom size plt.figure(figsize=(18, 6)) colors = ['yellow', 'green', 'blue', 'red'] # List of colors to cycle through for i in range(start, end, 4): # Ensure the range doesn't exceed the total number of data points plt.axvspan(i, min(i + 4, end), color=colors[(i // 4) % len(colors)], alpha=0.3) """ ideas: highlight the years where GDP growth rate was > 2% with green in the n-th quarter highlight the years where GDP growth rate was negative in the n-th quarter average the GDP growth rate and merge them into a single value then do further research into what contributed to the rise in certain years or what contributed to drops etc. """ # Plot the data plt.plot(x, y) # Rotate X-axis labels and shrink font size plt.xticks(rotation=90, fontsize=8) # Show the plot plt.show()