0

Wanted to connect points in matplotlib plot.below is the sample code. each element in list has timestamp and argv. Please educate.Code below plots correctly but do not connect points between different elements of list even if I have mentioned 'rs-'.

for a in list:
      plt.plot(a.time,a.argv,'rs-')
1
  • The code works fine for me; it creates a line with the points connected. Do you want to connect points in between different elements of list? Commented Apr 27, 2016 at 15:39

1 Answer 1

1

If you want your points connected, you need to plot them all in one call. Create a list of the points you want to plot, then call plt.plot

points = [(a.time, a.argv) for a in l]
plt.plot(points, "rs-")
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.