From 0e13833b85a87bb74b7ffa5673d8619cc302699d Mon Sep 17 00:00:00 2001 From: Adam Mayer Date: Tue, 2 Jan 2018 21:58:43 -0500 Subject: [PATCH] quick cut of xt/yt, needs to handle styles --- apple410/plot_to_cairo.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) 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]