I need a legend for a code which generates data from a dict. I don’t know how much keys exist in the dict is there a way to do ‘dynamic’ a legend on this?
import matplotlib.pyplot as plt
for host in d.keys():
plt.plot(range(100),d[host])
plt.show()
If I understand you, then sure: you simply need to turn the key into a label somehow, even if it’s as simple as calling str on it.