Tag: How To Plot Numpy Arrays?


  • How To Plot Numpy Arrays?

    How To Plot Numpy Arrays?

    How To Plot Numpy Arrays? Table Of Contents: Using ‘matplotlib’ Library To Plot The Numpy. Examples Of Plotting. Example-1 import matplotlib.pyplot as plt %matplotlib inline a = np.array([2, 1, 5, 7, 4, 6, 8, 14, 10, 9, 18, 20, 22]) plt.plot(a) Example-2 import matplotlib.pyplot as plt %matplotlib inline x = np.linspace(0, 5, 20) y = np.linspace(0, 10, 20) plt.plot(x, y, ‘purple’) # line plt.plot(x, y, ‘o’) # dots Example-3 import matplotlib.pyplot as plt %matplotlib inline fig = plt.figure() ax = fig.add_subplot(projection=’3d’) X = np.arange(-5, 5, 0.15) Y = np.arange(-5, 5, 0.15) X, Y = np.meshgrid(X, Y) R = np.sqrt(X**2 +

    Read More