summaryrefslogtreecommitdiff
path: root/lib/plotter.py
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-10-21 12:35:59 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2020-10-21 12:35:59 +0200
commit993a3bae7f5c560d8c9c601c9a6b423e9f507785 (patch)
treeaac250cd74e326f8ca88358725a00bc175253c46 /lib/plotter.py
parent7382103823962305df09b7ed1913597602a175e2 (diff)
--plot-traces: use the correct time base for each backend
Diffstat (limited to 'lib/plotter.py')
-rwxr-xr-xlib/plotter.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/plotter.py b/lib/plotter.py
index 16c0145..929ceb9 100755
--- a/lib/plotter.py
+++ b/lib/plotter.py
@@ -136,7 +136,11 @@ def plot_xy(X, Y, xlabel=None, ylabel=None, title=None, output=None, family=Fals
if family:
cm = plt.get_cmap("brg", len(Y))
for i, YY in enumerate(Y):
- plt.plot(np.arange(len(YY)), YY, "-", markersize=2, color=cm(i))
+ if X:
+ XX = X[i]
+ else:
+ XX = np.arange(len(YY))
+ plt.plot(XX, YY, "-", markersize=2, color=cm(i))
else:
plt.plot(X, Y, "bo", markersize=2)
if output: