plt.plot([], label='susceptible', color='blue', alpha=0.02)
plt.plot([], label='recovered', color='green', alpha=0.02)
plt.plot([], label='infected', color='red', alpha=0.02)
for simulation in range(200):
    plt.plot(num_s_nodes, color='blue', alpha=0.02)
plt.plot(num_r_nodes, color='green', alpha=0.02)
plt.plot(num_i_nodes, color='red', alpha=0.02)
plt.legend()
plt.show()
Pyplot: show only first 3 lines in legend