-2

I want to connect the plotted data points.

plt.plot(us, mu, 'ro', us, ru, 'go')
plt.show()
amin
  • 1,413
  • 14
  • 24
  • Add your codes to your question. – amin Nov 22 '16 at 10:26
  • 2
    `ro-`, `go-`. See http://matplotlib.org/api/pyplot_api.html?highlight=plot#matplotlib.pyplot.plot – Bart Nov 22 '16 at 10:28
  • Possible duplicate of [matplotlib: Set markers for individual points on a line](http://stackoverflow.com/questions/8409095/matplotlib-set-markers-for-individual-points-on-a-line) – Bart Nov 23 '16 at 07:21

1 Answers1

0

According to the pyplot documentation you can try this.

# adding dotted line between points
plt.plot(us, mu, 'r:o', us, ru, 'g:o')
plt.show()
amin
  • 1,413
  • 14
  • 24
  • There is no need to call the `plot()` command twice; Matplotlib is quite flexible in its formatting, so calling `plot`() once with `ro:` and `go:` produces the same result. – Bart Nov 22 '16 at 17:52
  • Thanks for your comment, i applied it. – amin Nov 23 '16 at 06:45