The following is an explanation of the code:
- fig = Figure() defines the figure object.
- FigureCanvas(fig) attaches the figure object to the canvas on which the figure will be drawn.
- fig.set(facecolor='grey', alpha=0.2, edgecolor='m') sets various attributes of the figure. More often, we use these attributes at the axis level for the individual plot. But here, we are using them at the figure level. ax = fig.add_subplot(111) instantiates the axes.
- x and y define the data co-ordinates where the tie objects are plotted.
- cycler() defines the property cycle with two properties, and four values for each. If we give more values to each of the properties, the cycle will be repeated after all the values in the list are covered.