I’m trying to plot a dataset with solid lines in matplotlib, but it looks strange that it has not a single line instead multiple lines appear in the plot. With the dot marker there is no problem. For comparison the two plots are shown below. Can someone tell me why this is happening?
>Solution :
It looks like you have a couple of glitches in the data, manifested as zeros in the x-data. Log of zero goes to negative infinity. You can filter out the zeros with something like:
mask = x.astype(bool)
x = x[mask]
y = y[mask]
plt.semilogx(x, y)

