How to plot a line in python

 How to plot a line in python

from matplotlib.pyplot import *

x = ([0,50]) 

y = ([0,50])

plot(x,y)

# it will read as 0,0 first point and 50,50 second point this is how this graph got plot

show()


this code can also be write as
import matplotlib.pyplot as plt

x = ([0,50]) 

y = ([0,50])

plt.plot(x,y)

plt.show()



Post a Comment

0 Comments