04pallav
9/11/2017 - 10:30 PM

meshgrid imshow

meshgrid imshow

import matplotlib.pyplot as plt
points = np.arange(-5,5,0.01)
dx,dy=np.meshgrid(points,points)
z=np.sin(dx)
plt.imshow(z)
#imshow is used for plotting images in matplotlib

z1 = (np.sin(dx) + np.sin(dy))
plt.imshow(z1)
plt.colorbar() #plots with a colorbar
plt.title("Plot for sin(x) and sin(y)") #title for the plot