本文整理匯總了Python中Plotter.Plotter.drawLineTo方法的典型用法代碼示例。如果您正苦於以下問題:Python Plotter.drawLineTo方法的具體用法?Python Plotter.drawLineTo怎麽用?Python Plotter.drawLineTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Plotter.Plotter
的用法示例。
在下文中一共展示了Plotter.drawLineTo方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: dash
# 需要導入模塊: from Plotter import Plotter [as 別名]
# 或者: from Plotter.Plotter import drawLineTo [as 別名]
#!/usr/bin/env python
import sys,collections,gc,time
from math import sqrt,sin,cos,acos,atan2,degrees,fabs,pow,modf,fmod
from Plotter import Point,Lengths,Plotter
def dash(x,y1,y2,slen):
draw = True
for y in range(int(y1+slen),int(y2),int(slen)):
print "drawing to ",x,",",y, " ", draw
v.drawLineTo(Point(x,y),draw)
draw = not(draw)
plotfile = open(sys.argv[1],'wb')
startx = long(sys.argv[2])
v = Plotter(plotfile)
#v.drawLineTo(v.pointFromLengths(Lengths(v.W+100,v.W+100)),False)
c = (startx,200.0)
for x in range(0,100,10):
v.drawLineTo(Point(c[0]+x,c[1]),False)
print "starting at ", c[0]+x,",",c[1]
dash(c[0]+x,c[1],c[1]+200.0,10)
v.reset()
print ("done.")