用python绘图

绘制五角星

import turtle as t

t.setup()
t.penup()
t.fd(-100)
t.pendown()
t.pensize(10)
t.pencolor("green")
t.circle(1,36)
t.fd(200)
t.circle(1,-144)
t.fd(200)
t.circle(1,-144)
t.fd(200)
t.circle(1,-144)
t.fd(200)
t.circle(1,-144)
t.fd(200)
t.right(150)

t.done()

用python绘图

绘制笑脸

import turtle as t

t.setup()
t.penup()
t.fd(-100)
t.pendown()
t.pensize(10)
t.pencolor("green")

t.circle(50,360)
t.circle(100,360)
t.circle(20,360)
t.circle(10,360)
t.circle(5,360)
t.right(150)
t.circle(50,360)
t.circle(100,360)
t.circle(20,360)
t.circle(10,360)
t.circle(5,360)
t.penup()
t.fd(300)
t.pendown()
t.left(-280)
t.circle(300,360)
t.penup()
t.left(150)
t.fd(200)
t.pendown()
t.right(200)
t.circle(100,100)
t.penup()
t.left(80)
t.fd(100)
t.pendown()
t.circle(10,360)
t.circle(5,360)
t.circle(20,360)


t.done()

用python绘图

上一篇:latex入门(一) 基本结构,语法与中文操作


下一篇:Ising模型的Metropolis模拟中的组态阻塞和振荡