I found several questions similar to mine, but the answers don't work in my case... I think, in my case it is something different and I need some help to figure out what it is.
My script reads two files with 50000 values for x and y and I plot these values with matplotlib plot function.
I inserted some print statements to figure out why it takes more then a minute or sometimes longer... So the last "DONE!" (before plt.show()) comes after lets say 2 seconds, but then everything stucks...
Sometimes I get a picture in a minute, and then sometimes, the same thing, takes 5 minutes or I kill the process.
Can anyone help? I am working on a Mac from 2012...
colors = cm.rainbow(np.linspace(0, 1, len(data_dict.keys())))
fig, ax = plt.subplots(dpi=150)
for key,c in zip(data_dict.keys(),colors):
ax.plot(x,
data_dict[key],
label=key,
color=c,
alpha=.5)
print("%s DONE!" % (key))
ax.axhline(1,color='red',linestyle='--')
ax.grid(True)
ax.set_xlabel("Zeit in ns")
ax.set_ylabel("Distanz in nm")
legend = ax.legend()
print("DONE!")
plt.show()