Commit 42aa53cc authored by Niels-Oliver Walkowski's avatar Niels-Oliver Walkowski
Browse files

correct time stamps of plot tickers

time stamps were counted with fps=1, fps=4 is currently used for the extraction
of frames with ffmpeg
parent f289c25f
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -21,7 +21,18 @@ class SequencePlot(object):
view._frame_step)] # um X-Achse Minuten anzeigen zu lassen
def _timelabels(self, val, pos):
min, sec = divmod(int(val), 60)
"""counts time values for plot tickers
Arguments:
val {int} -- default ticker value (frame number) as used by matplotlib
pos {int} -- current ticker position as passed by the matplotlib.FuncFormatter
Returns:
str -- timecode for the given ticker label (frame number)
"""
val, _ = divmod(int(val), 4) # scale frame number from fps=4 to fps=1
min, sec = divmod(int(val), 60) # calculate timecode
timelabel = "{0}:{1:02d}".format(min, sec)
return timelabel
......
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