How to connect scatterplot points with line using matplotlib

I think @Evert has the right answer:

plt.plot(dates, values)

Which is pretty much the same as

plt.plot(dates, values, '-o')

You can replace -o with another suitable format string as described in the documentation.
You can also split the choices of line and marker styles using the linestyle= and marker= keyword arguments.

Leave a Comment