Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions brachiograph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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]
Expand Down Expand Up @@ -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]
Expand Down