I am trying to do something fairly simple and can't find a simple way to do it. I'm trying to shade a region of a plot so that it is completely covered. I have an example code that does almost what I want below, but you can still see the data in green. I want to cover that completely.
import matplotlib.pyplot as plt
import numpy as np
plt.plot(np.linspace(0,2.0 * np.pi,30),np.sin(np.linspace(0,2.0 * np.pi,30)),color='green')
plt.axhspan(-1.5, 1.5, xmin=0.66, xmax=1,color='gray')
plt.xlim(0,2.0 * np.pi)
plt.ylim(-1.5,1.5)