You are on page 1of 6

In 

[9]: #sharan 90 cseb


import matplotlib.pyplot as plt

x=[1,2,3,4,6,7,8]
y=[2,7,9,1,5,10,3]
plt.scatter(x,y)
plt.xlabel('x-axis')
plt.ylabel('y-axis')
plt.title('Scatter points')
plt.show()
In [13]: #sharan 90 cseb
import matplotlib.pyplot as plt
x=[1,2,3,4,6,7,8]
y=[2,7,9,1,5,10,3]
plt.plot(x,y,'r+-')
plt.xlabel('x-axis')
plt.ylabel('y-axis')
plt.title('graph lines!')
plt.show()
In [18]: #sharan 90 cseb
import numpy as np
import matplotlib.pyplot as plt

x= np.arange(-10,10,0.001)
y= np.exp(x)
plt.plot(x,y)
plt.title("Exponential curve")
plt.grid()
plt.show()
In [23]: #sharan 90 cseb
import numpy as np
import matplotlib.pyplot as plt
x= np.arange(-10,10,0.001)
y1=np.sin(x)
y2=np.cos(x)
plt.plot(x,y1,x,y2)
plt.title("Sine curve and Cosine curve")
plt.xlabel("values of X")
plt.ylabel("values of sin(x) and cos(x)")
plt.grid()
plt.show()
In [24]: #sharan 90 cseb
import numpy as np
import matplotlib.pyplot as plt
x=np.linspace(0,2,100)
plt.plot(x,x,label='linear')
plt.plot(x,x**2,label='quadratic')
plt.plot(x,x**3,label='cubic')

plt.xlabel('X label')
plt.ylabel('Y label')

plt.title("simple Plot")
plt.legend()
plt.show()
In [31]: #sharan 90 cseb
#Circle: x2+y2=5
from sympy import plot_implicit,symbols,Eq
x,y=symbols('x y')
p1 =plot_implicit(Eq(x**2+y**2,4),(x,-4,4),(y,-4,4),title='Circle:$x^2+y^2=4$'

In [ ]: ​

You might also like