2024.8.27
黑夜.00:30
代码
import matplotlib.pyplot as plt
def draw_celebrate(size=200):
fig = plt.figure(figsize=(size, size))
ax = fig.add_axes([0, 0, 1, 1])
ax.axis('off')
# 绘制庆字
fontsize = size * 0.8
x = size / 2
y = size / 2
plt.text(x, y, '庆', fontsize=fontsize,
horizontalalignment='center',
verticalalignment='center')
plt.show()
运行函数
draw_celebrate()