1. 首页 > 游戏评测

圣诞节金色雪花ai格式 圣诞雪花装饰

作者:admin 更新时间:2026-03-27
摘要:import matplotlib.pyplot as plt import numpy as np # 设置画布大小 plt.figure(figsize=(8, 8)) # 创建一个白色背景的画布 ax = plt.gca() ax.set_xlim(0...,圣诞节金色雪花ai格式 圣诞雪花装饰

 

import matplotlib.pyplot as plt
import numpy as np
# 配置画布大致
plt.figure(figsize=(8, 8))
# 创建壹个白色背景的画布
ax = plt.gca()
ax.set_xlim(0, 10)
ax.set_ylim(0, 10)
ax.set_aspect('equal', adjustable='box')
ax.axis('off')
# 雪花形状的参数方程
t = np.linspace(0, 2 * np.pi, 100)
x = 3 * np.sin(t) + 5 * np.sin(2 * t)
y = 3 * np.cos(t) + 5 * np.cos(2 * t)
# 绘制金色雪花
ax.plot(x, y, color='gold', linewidth=2)
# 添加一些金色的小点来模拟雪花上的冰晶
np.random.seed(0)  # 确保每次生成的随机点相同
for _ in range(50):
    point = np.random.rand() * 10, np.random.rand() * 10
    ax.plot(point[0], point[1], 'o', color='gold', markersize=2)
# 显示图像
plt.show()