How to hide lines with .plot

Question:

I do not want to connect points with lines. I know that for that I can use scatter. But, scatter does not work after plot.

So, basically I have to lists of points. The points from the first list I do want to connect with lines while the points from the second list should not be connect with lines.

How can one achieve it in matplotlib?

This is what I have tried:

plt.figure()
plt.plot(xys[:,0], xys[:,1], marker='o', color='g')

# WHAT SHOULD I DO HERE?
#plt.plot(xys_bad[:,0], xys_bad[:,1], color='r', linewidth=0.0, markersize = 10.0)
plt.scatter(xys_bad[:,0], xys_bad[:,1], color='r')

plt.show()
Asked By: Roman

||

Answers:

As describe in matplotlib documentation you should use the 'None' linestyle:

plt.plot(xys_bad[:,0], xys_bad[:,1], color='r', linestyle='None', markersize = 10.0)
Answered By: Xavier C.
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.