From 993a3bae7f5c560d8c9c601c9a6b423e9f507785 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 21 Oct 2020 12:35:59 +0200 Subject: --plot-traces: use the correct time base for each backend --- lib/plotter.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/plotter.py') 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: -- cgit v1.2.3