Matplotlib cannot set line shape

created at 07-31-2021 views: 2

As shown in the figure, the shape of lines[0] cannot be changed

code and figure


The reason is that lines[0] is a dotted line, the color is blue, and it coincides with the solid red line of plt.plot(x,y) I drew at the end.

So it looks as if lines[0] does not set the line shape, but it is actually covered by the following lines.

The solution is to delete the statement plt.plot(x,y) in the penultimate line.

created at:07-31-2021
edited at: 07-31-2021: