# 用matplotlib绘制甜甜圈饼图
# The effect of the donut shape is achieved by setting a width to the pie's wedges through the wedgeprops argument.
%matplotlib inline # matplotlib的图表直接嵌入到Notebook之中, 仅在jupyter notebook 或 jupyter qtconsole有用
import matplotlib.pyplot as plt
import numpy as np
# Create a figure and a set of subplots
# Returns
# fig : :class:`matplotlib.figure.Figure` object
# ax : Axes object or array of Axes objects.
#
# ax can be either a single :class:`matplotlib.axes.Axes` object or an
# array of Axes objects if more than one subplot was created.
fig, ax = plt.subplots() # 1*1画布
size = 0.3
vals = np.array([[60., 32.], [37., 40.], [29., 10.]]) # 3*2 array
cmap = plt.get_cmap("tab20c") # Get a colormap instance, matplotlib.cm
outer_colors = cmap(np.arange(3)*4) # cmap([0,4,8]), len(cmap.colors) -> 20
inner_colors = cmap(np