Py 19
Py 19
import numpy as np
x = [1, 2, 3, 4, 5]
y = [2, 4, 6, 8, 10]
matrix1 = np.array([[1, 2, 3],
[4, 5, 6]])
plt.plot(x, y, label="y = 2x", color='blue',
matrix2 = np.array([[7, 8, 9],
marker='o')
[10, 11, 12]])
plt.xlabel('X-axis')
print("Matrix 1:")
plt.ylabel('Y-axis')
print(matrix1)
plt.title('Line Graph: y = 2x')
print("\nMatrix 2:")
plt.grid(True)
print(matrix2)
dot_product_matrix = np.dot(matrix1,
matrix2.T)
print("\nDot product of Matrix 1 and Matrix 2
(after transpose):")
print(dot_product_matrix)
transpose_matrix1 = np.transpose(matrix1)
print("\nTranspose of Matrix 1:")
print(transpose_matrix1)