#创建画布
fig = plt.figure(figsize=(12, 8),
facecolor='beige', #米黄色
)#划分子区
axes = fig.subplots(nrows=2,
ncols=3,
subplot_kw={'aspect': 'equal'}
)#--------------------------------- subplot(221) ---------------------------------
ax =axes[0, 0]
angles= np.linspace(0, 135, 4) #线型序列
ellipses = [Ellipse(xy=(2,2), #中心
width=4, #长半轴
height=2, #短半轴
angle=a, #旋转角度(逆时针)
) for a inangles
]for ellipse inellipses:
ax.add_patch(p=ellipse) #向子区添加形状
ellipse.set(alpha=0.4,
color='lightskyblue')
ax.axis([-1, 5, -1, 5]) #坐标轴刻度范围 [xmin, xmax, ymin, ymax]
#--------------------------------- subplot(222) ---------------------------------
ax = axes[0, 1]
angles= np.linspace(0, 180, 4, endpoint=False) #线型序列