In [12]:
A = np.zeros((2,2))
theta = np.pi / 4; 
A[0,0] = np.cos(theta)
A[0,1] = - np.sin(theta)
A[1,0] = np.sin(theta)
A[1,1] = np.cos(theta)

print(A)
[[ 0.70710678 -0.70710678]
 [ 0.70710678  0.70710678]]
In [13]:
X_new_mesh = A[0,0] * x_mesh + A[0,1] * y_mesh
Y_new_mesh = A[1,0] * x_mesh + A[1,1] * y_mesh
In [14]:
plt.scatter(X_new_mesh,Y_new_mesh, c=y_mesh)
plt.axis('equal')
Out[14]:
(-15.566205816928417,
 15.566205816928415,
 -15.571525786545548,
 15.571525786545546)