Here is a solution that directly uses matplotlib:
# code until "plotting" same as question # plotting simlen = 5 for c in columns: for i in range(0, len(index), simlen): plt.plot(index[i:i+simlen], dataset[i:i+simlen][c], color=dict(A='b', B='g')[c], label=c if i == 0 else None) plt.legend() plt.show()
(I assumed that each simulation has a length of 5, which was not explicit in your question. Note that the data may be structured differently since pandas is no longer used for construction.)
Here's the conclusion: 
source share