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()
How to discontinue a line graph in the plot pandas or matplotlib python