I'm trying to plot one diagram of both cyclical components(gdp and hoursworked) using HP-filters and matplotlib in python. Currently only getting one figure to plot and other figure is flatline(HoursWorked is flatlined) (Image below). Any pointers on how to improve code.
import statsmodels.api as sm
import matplotlib.pyplot as plt
pandas_datareader import data
import datetime as dt
start, end = dt.datetime(1965, 1, 1), dt.datetime(2016,12, 31)
gdp = data.DataReader('GDPC1', 'fred', start, end)
HoursWorked = data.DataReader('PRSCQ', 'fred', start, end)
plt.figure(1)
plt.subplot(211)
plt.plot(gdp)
plt.title('RealGDP and Hours Worked')
cycle, trend = sm.tsa.filters.hpfilter(gdp, 1600)
plt.figure(1)
plt.subplot(211)
plt.plot(HoursWorked)
ax = plt.gca()
ax.set_xticklabels([])
plt.show()
[
2

prscqis not defined in this code snippet.HoursWorkedlook like? It could be that your y axis has scaled in order to encompass all the data forgdpand thereforeHoursWorkedjust looks like a flat line. You could try just plottingHoursWorkedon its own to see?