collections is a container of similar objects that share many properties.
Plotting collections using object-oriented API
Getting ready
Import the required libraries:
from matplotlib import collections
from IPython.core.display import display
from matplotlib.backends import backend_agg
import numpy as np
How to do it...
The following code block plots a collection of polygons that cycle through a given number of sizes and a given list of colors:
- Define the data for plotting a collection of polygons:
nsizes = 50 #number of different sizes to be used to plot the items in...