How to plot graphs in Python using Matplotlib

Hello, I am back with another article on Graphs in Python.
To plot graphs we will be using two python libraries
  • matplotlivb
  • numpy
  • Let's go on to code,
  • Importing libraries
  • import matplotlib.pyplot as plt
    import numpy as np
  • Entering values plotted on the graph
  • x = np.array([200, 400])
    y = np.array([0, 100])
  • Plotting them
  • plt.plot(x, y)
  • Displaying Graph
  • plt.show()
    Make sure to check out the video

    36

    This website collects cookies to deliver better user experience

    How to plot graphs in Python using Matplotlib