Commit 6286ad74 authored by Michael König's avatar Michael König

parameter for static y-axis (disables autoscaling)

parent f62515ab
...@@ -369,24 +369,28 @@ class LiveGui(GuiBase): ...@@ -369,24 +369,28 @@ class LiveGui(GuiBase):
self.__lastDrawTimestamp = time.perf_counter() self.__lastDrawTimestamp = time.perf_counter()
# y-scaling if(self.options.yAxisMax is 0):
lines = self.__ax.get_lines() # y-scaling (autoscaling)
bot,top = np.inf, -np.inf lines = self.__ax.get_lines()
for line in lines: bot,top = np.inf, -np.inf
if(line.get_visible()): for line in lines:
new_bot, new_top = self.determineNewYvalues(line) if(line.get_visible()):
new_bot, new_top = self.determineNewYvalues(line)
if(new_bot != new_top):
if(new_bot < bot): if(new_bot != new_top):
bot = new_bot if(new_bot < bot):
if(new_top > top): bot = new_bot
top = new_top if(new_top > top):
top = new_top
if(bot != np.inf and top != -np.inf):
self.__ax.set_ylim(bot, top) if(bot != np.inf and top != -np.inf):
self.__ax.set_ylim(bot, top)
else:
# intial y-scale
self.__ax.set_ylim(0, 500)
else: else:
# intial y-scale # static y-axis (no autoscaling)
self.__ax.set_ylim(0, 500) self.__ax.set_ylim(0, self.options.yAxisMax)
return self.returnAllLines() return self.returnAllLines()
......
...@@ -192,6 +192,14 @@ def parse_options(): ...@@ -192,6 +192,14 @@ def parse_options():
type=int, type=int,
default=20) default=20)
parser.add_argument(
"-y",
help="Static Y-axis (default: 0 = auto)",
dest="yAxisMax",
type=int,
default=0)
# TODO: remove as param # TODO: remove as param
parser.add_argument( parser.add_argument(
"-r", "-r",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment