Login using Social Account
     Continue with GoogleLogin using your credentials
Scatter plots show how much one variable is affected by another. The relationship between two variables is called their correlation.
Import pyplot
import matplotlib.<< your code goes here >> as plt
Import rand
to generate random values for the x-, and y-coordinates
from numpy.random import << your code goes here >>
Now we will call the scatter
module to generate the scatter plot.
for color in ['red', 'green', 'blue']:
n = 100
x, y = rand(2, n)
scale = 500.0 * rand(n) ** 5
plt.<< your code goes here >>(x, y, s=scale, c=color, alpha=0.3, edgecolors='blue')
plt.grid(True)
plt.show()
Here, s
is a scalar or array-like shape, and is an option argument. c
defines the color. alpha
defines the alpha blending value, or the transparency. edgecolor
is the line color of the shapes. grid
displays the plot grid.
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...