标签:oval 转换 span 显示 graph lin class creat code
tkinter中坐标原点在左上角,横坐标向右,纵坐标向下,画图需要将坐标转换成右下角的某个点来符合我们的常用坐标
坐标原点设为(x0,y0),横坐标向右,纵坐标向上,:
转换:想实现坐标点(x,y)的显示
实际显示点坐标是(x0+x,y0-y)
xlinepoint=[20,500,900,500] ylinepoint=[20,500,20,20] xy=[20,500,20+40,500-40,20+120,500-200] traceID = graph.create_oval(20-1,500-1,20+1,500+1,fill=‘black‘) traceID1= graph.create_line(xlinepoint,fill=‘black‘) traceID1= graph.create_line(ylinepoint,fill=‘black‘) traceID1= graph.create_line(xy,fill=‘black‘)
以上程序实现的是坐标原点移到(20,500)后显示原点 (40,40),(120,200)三点的连线
标签:oval 转换 span 显示 graph lin class creat code
原文地址:https://www.cnblogs.com/mghhzAnne/p/10980856.html