python绘制玫瑰

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python绘制玫瑰相关的知识,希望对你有一定的参考价值。

import turtle

turtle.fillcolor("red")
turtle.begin_fill()

turtle.circle(10,180)
turtle.circle(25,100)
turtle.left(60)
turtle.circle(100,30)
turtle.circle(20,180)
turtle.right(30)
turtle.circle(100,30)
turtle.circle(50,70)

turtle.left(10)
turtle.fd(30)

turtle.right(160)
turtle.fd(15)

turtle.left(150)
turtle.circle(90,100)

turtle.left(40)
turtle.circle(110,73)


turtle.end_fill()


turtle.left(140)
turtle.circle(-80,60)
turtle.left(40)
turtle.circle(45,120)

turtle.left(90)
turtle.circle(60,90)
turtle.circle(-46,55)


turtle.penup()
turtle.right(163)
turtle.fd(125)
turtle.right(40)
turtle.pendown()
turtle.circle(200,10)


turtle.left(90)
turtle.fd(15)
turtle.left(60)

turtle.fillcolor("green")
turtle.begin_fill()
turtle.circle(-30,45)
turtle.circle(-30,60)
turtle.right(80)
turtle.circle(-30,65)
turtle.circle(-32,32)
turtle.end_fill()

turtle.right(130)
turtle.fd(30)

turtle.penup()
turtle.left(180)
turtle.fd(47)
turtle.pendown()
turtle.left(90)
turtle.circle(-200,20)

turtle.right(110)
turtle.fd(15)
turtle.fillcolor("green")
turtle.begin_fill()
turtle.circle(30,45)
turtle.circle(30,45)
turtle.left(90)
turtle.circle(30,45)
turtle.right(20)
turtle.circle(60,35)
turtle.end_fill()
turtle.left(150)
turtle.fd(30)

turtle.penup()
turtle.left(180)
turtle.fd(26)
turtle.right(90)
turtle.pendown()
turtle.circle(200,60)



























































以上是关于python绘制玫瑰的主要内容,如果未能解决你的问题,请参考以下文章

python绘制玫瑰

Python 玫瑰花绘制

使用 python 中的 windrose 模块绘制带有风玫瑰的不同子图。在 matplotlib 中使用睡眠

数据可视化应用绘制风玫瑰图(附Python代码)

python3使用matplotlib绘制风速风向玫瑰图

9.5 Python 实例16-玫瑰花绘制