From 74c3d639cc5375b6ce04a2fa292f60773cec56af Mon Sep 17 00:00:00 2001 From: Noah Doersing Date: Sat, 2 May 2020 18:06:13 +0200 Subject: [PATCH 1/2] Fix incorrect (?) flip=True within plot_file() and plot_lines() --- brachiograph.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/brachiograph.py b/brachiograph.py index 300cffd..0bb26ae 100755 --- a/brachiograph.py +++ b/brachiograph.py @@ -161,7 +161,7 @@ def plot_file(self, filename="", wait=0, interpolate=10, bounds=None): with open(filename, "r") as line_file: lines = json.load(line_file) - self.plot_lines(lines=lines, wait=wait, interpolate=interpolate, bounds=bounds, flip=True) + self.plot_lines(lines=lines, wait=wait, interpolate=interpolate, bounds=bounds) def plot_lines(self, lines=[], wait=0, interpolate=10, rotate=False, flip=False, bounds=None): @@ -172,7 +172,7 @@ def plot_lines(self, lines=[], wait=0, interpolate=10, rotate=False, flip=False, if not bounds: return "Line plotting is only possible when BrachioGraph.bounds is set." - lines = self.rotate_and_scale_lines(lines=lines, bounds=bounds, flip=True) + lines = self.rotate_and_scale_lines(lines=lines, bounds=bounds, flip=flip) for line in tqdm.tqdm(lines, desc="Lines", leave=False): x, y = line[0] From 34dcba0a25a86a20d69c2ac7fbdd0e9a2ded9563 Mon Sep 17 00:00:00 2001 From: Noah Doersing Date: Sun, 3 May 2020 20:55:50 +0200 Subject: [PATCH 2/2] Fix (?) flipping code --- brachiograph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brachiograph.py b/brachiograph.py index 0bb26ae..5db9951 100755 --- a/brachiograph.py +++ b/brachiograph.py @@ -232,7 +232,7 @@ def rotate_and_scale_lines(self, lines=[], rotate=False, flip=False, bounds=None x = x / divider # scale x values to fit in our box width x = x + box_x_mid_point # shift x values so that they have the box x midpoint as their endpoint - if flip ^ rotate: + if flip: x = -x y = point[1]