Login using Social Account
     Continue with GoogleLogin using your credentials
Now we will create a simple plot using Matplotlib's Pyplot module.
First, we need to define 2 arrays X and Y of 5 values in each of them for the x- and y-coordinates respectively. To do this, we need to import Numpy as most of the data that we will be working with will be in the form of arrays only:
import << your code goes here >> as np
Then we will declare the X and Y variables:
X = np.array([1, 2, 5, 8, 12])
Y = np.array([3, 6, 7, 12, 9])
Now we will import Pyplot:
import matplotlib.<< your code goes here >> as plt
Next, we will pass the X and Y arrays as input arguments to Pyplot’s plot
method:
plt.<< your code goes here >>(X, Y)
Finally, we will use the show
method to display this plot we created:
plt.<< your code goes here >>()
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...