Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect (?) flip=True within plot_file() and plot_lines() #84

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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