Here is an explanation of the code:
np.random.seed() is required to ensure that we get the same data points from any np.random.* function we may use subsequently. This ensures repeatability of the graph.
- plt.style.use('ggplot') specifies the style to be used for the figure.
- ax1.plot(x, y, 'cH') plots 500 random points on ax1 patches.
- Ellipse() adds an ellipse patch to ax1 at the center of the axes.
- (0.5, 0.5) are the co-ordinates for the center of the ellipse, 0.6 is the width and 0.3 is the height.
- transform=ax1.transAxes specifies that co-ordinates in the axes co-ordinate system need to be transformed to display co-ordinates before displaying the picture on the screen.
- On ax2, we plot two normal distributions with ...