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

implement markers for UnivariatePlots

parent 86c0b389
......@@ -3,6 +3,7 @@
import matplotlib.pyplot as plt
import matplotlib.ticker as plticker
import numpy as np
class SequencePlot(object):
......@@ -92,7 +93,6 @@ class MultivariatePlot(SequencePlot):
x = view[:, 0]
y = view[:, 1]
value = view[:, 2]
print('x: {0} | y: {1} | value: {2}'.format(x, y, value))
thickness = list([int((v - view._threshold) / 4000) for v in value])
self._ax, axt = self.ittenstyle(self._ax, view)
......@@ -118,13 +118,26 @@ class UnivariatePlot(SequencePlot):
self.fig = plt.figure()
self._ax = plt.axes()
self._ax, self._axt = self.ittenstyle(self._ax, view)
self.plot(view)
def plot(self, view):
def plot(self, view, mark_gt=False, mark_lt=False):
# Interpolation mit savitzky_golay funktioniert nicht
# contrast_points = savitzky_golay(np.array(contrast_points), 51, 7)
self._axt.plot(self._x, view, label=view.feature)
self._axt.plot(self._x, view, label=view.feature)
# TODO Überführbar in Superclass?
# evtl. auch eher feature drer View Klasse
# TODO self._x sollte eine array sein
npx = np.array(self._x)
if mark_gt:
poss = npx[view > mark_gt]
for pos in poss:
self._ax.axvline(pos, color='#f3f315', alpha=0.3, linewidth=3)
elif mark_lt:
poss = npx[view > mark_gt]
for pos in poss:
self._ax.axvline(pos, color='#f3f315', alpha=0.3, linewidth=3)
self._axt.legend()
return self.fig
......@@ -3,12 +3,12 @@ from itten.views import UnivariateSequence
from itten.visuals import UnivariatePlot
movie = Movie(prefix='rec_', folder='../DHd-2017/Data/Frames/Rec/')
# movie._frames.start = 367
# movie._frames.end = 784
movie._frames.start = 367
movie._frames.end = 784
cont = UnivariateSequence(movie._frames,)
cont.seqmean(frm_stp=3, ctrst='saturation')
viz = UnivariatePlot(cont)
# viz.plot(cont)
viz.plot(cont, mark_gt=140)
cont.seqmad(frm_stp=3, ctrst='saturation')
viz.plot(cont)
viz.saveplt()
......
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