diff options
-rw-r--r-- | qolab/data/trace.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/qolab/data/trace.py b/qolab/data/trace.py index 624ff46..623b2af 100644 --- a/qolab/data/trace.py +++ b/qolab/data/trace.py @@ -71,10 +71,17 @@ class TraceSetSameX: def plot(self): import matplotlib.pyplot as plt + nplots = len(self.traces.keys()) + cnt=0 for k, tr in self.traces.items(): + cnt+=1 + if cnt == 1: + ax1=plt.subplot(nplots, 1, cnt) + else: + plt.subplot(nplots, 1, cnt, sharex=ax1) plt.plot(self.x.values, tr.values, label=tr.label) - plt.xlabel(self.x.label) - plt.legend() + plt.xlabel(self.x.label) + plt.legend() def items(self): return (self.traces.items()) |