python画图王者荣耀赵云
时间: 2023-11-02 16:02:25 浏览: 209
以下是Python代码,可以画出王者荣耀中的赵云:
```python
import matplotlib.pyplot as plt
from matplotlib.patches import Circle, Rectangle
# 创建画布和坐标系
fig, ax = plt.subplots()
# 绘制身体
body = Rectangle((0, 0), 10, 20, linewidth=2, edgecolor='black', facecolor='white')
ax.add_patch(body)
# 绘制头部
head = Circle((5, 25), 5, linewidth=2, edgecolor='black', facecolor='white')
ax.add_patch(head)
# 绘制左手臂
left_arm = Rectangle((0, 12), 5, 8, linewidth=2, edgecolor='black', facecolor='white')
ax.add_patch(left_arm)
# 绘制右手臂
right_arm = Rectangle((5, 12), 5, 8, linewidth=2, edgecolor='black', facecolor='white')
ax.add_patch(right_arm)
# 绘制左腿
left_leg = Rectangle((1, 0), 3, 12, linewidth=2, edgecolor='black', facecolor='white')
ax.add_patch(left_leg)
# 绘制右腿
right_leg = Rectangle((6, 0), 3, 12, linewidth=2, edgecolor='black', facecolor='white')
ax.add_patch(right_leg)
# 绘制左手持枪
left_hand = Rectangle((0, 15), 1, 5, linewidth=2, edgecolor='black', facecolor='white')
ax.add_patch(left_hand)
# 绘制枪
gun = Rectangle((1, 16), 5, 3, linewidth=2, edgecolor='black', facecolor='white')
ax.add_patch(gun)
# 绘制右手持盾
right_hand = Rectangle((9, 15), 1, 5, linewidth=2, edgecolor='black', facecolor='white')
ax.add_patch(right_hand)
# 绘制盾
shield = Rectangle((5, 10), 5, 5, linewidth=2, edgecolor='black', facecolor='white')
ax.add_patch(shield)
# 调整坐标系
ax.set_xlim(-2, 12)
ax.set_ylim(-2, 28)
# 隐藏坐标轴
ax.set_xticks([])
ax.set_yticks([])
# 显示画图结果
plt.show()
```
画出的赵云图如下所示:
![赵云图](https://img-blog.csdnimg.cn/20210707104802383.png)
阅读全文