diff --git a/apple410/plot_to_cairo.py b/apple410/plot_to_cairo.py index 8be1d5f..6d8724a 100755 --- a/apple410/plot_to_cairo.py +++ b/apple410/plot_to_cairo.py @@ -168,6 +168,42 @@ class CairoPlotter: p=self.context.get_current_point() self.context.arc(p[0],p[1],r,0.0,math.pi*2) + def yt(self, params): + l=coordlist(params,5) + left = l[3] + right = l[4] + num = int(l[2]) + if l[0]: + dist = l[1] + tw = dist/num + else: + dist = l[1]*num + tw = l[1] + (x,y) = self.context.get_current_point() + self.context.line_to(x,y+dist) + for i in range(num): + y1 = y + tw*(i+1) + self.context.move_to(x+left,y1) + self.context.line_to(x-right,y1) + + def xt(self, params): + l=coordlist(params,5) + above = l[3] + below = l[4] + num = int(l[2]) + if l[0]: + dist = l[1] + tw = dist/num + else: + dist = l[1]*num + tw = l[1] + (x,y) = self.context.get_current_point() + self.context.line_to(x+dist,y) + for i in range(num): + x1 = x + tw*(i+1) + self.context.move_to(x1,y+above) + self.context.line_to(x1,y-below) + def ac(self,params): l=coordlist(params) r=l[0]