我写了一个海龟程序,用数据在图表上画一条线。除了我调用chartlines中的make_line()之外,一切正常。goto太过分了,但没有划出一条线。即使我把乌龟。下来()在我进入While循环之前它没有画线。在import turtle
def Change_tekenpunt(x,y):
turtle.up()
turtle.goto(x,y)
turtle.down()
def xAxisTurtle(days):
xAxis = turtle
xAxis.ht()
Change_tekenpunt(-300, -220)
x = -275
for i in range(0,days+1):
xAxis.write(i)
Change_tekenpunt(x, -220)
x+=25
def yAxisTurtle():
yAxis = turtle
yAxis.ht()
Change_tekenpunt(-310, -200)
y = -160
for i in range(0, 1601, 200):
yAxis.write(i)
Change_tekenpunt(-330, y)
y+=50
def point():
turtle.begin_fill() # Begin to fill color in a shape
turtle.color("black")
turtle.circle(3) # Draw a circle
turtle.end_fill() # Fill