Unit 5 Matplotlib - Ipynb - Colab
Unit 5 Matplotlib - Ipynb - Colab
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = plt.axes()
X-123Y-149
#Printing x vs x square
fig = plt.figure()
ax = plt.axes()
x = np.array([1,2,3,4])
y= x**2 # x^2
ax.plot(x, y);
plt.title("FDS")
plt.xlabel("x")
plt.ylabel("y");
plt.xlim(5,25)
plt.ylim(-1,-10);
plt.show()
Scatter plots are used to observe relationship between variables and uses dots to represent the relationship between them. The scatter()
method in the matplotlib library is used to draw a scatter plot. Scatter plots are widely used to represent relation among variables and how
change in one affects the other.
#Scatter plots
#linspace(start,stop,number of entries)
#x = np.linspace(0, 10, 30)
#y = np.sin(x)
x= np.array([1,2,3,4,5])
y=np.array([2,4,6,8,10])
plt.scatter(x, y, marker='x');
# example data
#xval = np.arange(1, 4, 0.5)
#yval = np.exp(-xval)
xval= np.array([1,2,3,4,5])
yval=np.array([2,4,6,8,10])
if (j == M):
print("Pattern found at index ", i)
search()
Could not connect to the reCAPTCHA service. Please check your internet connection and reload to get a reCAPTCHA challenge.