I want to create a chart with a for loop. X-axis is plotted correctly and even y-axis scale is set correctly, but no actual line chart is created. What could be wrong with the code below?
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
test = {'date':[2012, 2013, 2014, 2015],'val':[9,15,12,20]}
test_df=pd.DataFrame(data=test)
test_df=test_df.set_index('date')
fig, ax = plt.subplots(figsize=(25,25))
for i in range(0, len(test_df)):
ax.plot(test_df.index[i], test_df['val'].iloc[i], color='blue', linewidth=10)
plt.show()