I would to plot corresponding values on line charts. Can you please let me know how can I do that?
import matplotlib.pyplot as plt
x = [1,2,3]
y = [3,4,5]
z = [6,7,8]
plt.plot(x, y)
plt.plot(x, z)
plt.show()
Thanks.
I would to plot corresponding values on line charts. Can you please let me know how can I do that?
import matplotlib.pyplot as plt
x = [1,2,3]
y = [3,4,5]
z = [6,7,8]
plt.plot(x, y)
plt.plot(x, z)
plt.show()
Thanks.
You can add value tag to the point by using a for
loop over the data points in cartesian coordinate.
import matplotlib.pyplot as plt
x = [1,2,3]
y = [3,4,5]
z = [6,7,8]
plt.plot(x, y, '*--')
for a,b in zip(x, y):
plt.text(a, b, str(b),fontsize=20)
plt.plot(x, z, '*--')
for a,b in zip(x, z):
plt.text(a, b, str(b),fontsize=20)
plt.ylim(0, 10)
plt.show()