|
14 | 14 |
|
15 | 15 | from .base import BasePlot
|
16 | 16 | import qcodes.config
|
| 17 | +from qcodes.data.data_array import DataArray |
| 18 | + |
17 | 19 |
|
18 | 20 | class MatPlot(BasePlot):
|
19 | 21 | """
|
@@ -55,7 +57,7 @@ def __init__(self, *args, figsize=None, interval=1, subplots=None, num=None,
|
55 | 57 | subplots = max(len(args), 1)
|
56 | 58 |
|
57 | 59 | self._init_plot(subplots, figsize, num=num)
|
58 |
| - |
| 60 | + |
59 | 61 | # Add data to plot if passed in args, kwargs are passed to all subplots
|
60 | 62 | for k, arg in enumerate(args):
|
61 | 63 | if isinstance(arg, Sequence):
|
@@ -417,11 +419,17 @@ def scale_formatter(i, pos, scale):
|
417 | 419 | return "{0:g}".format(i * scale)
|
418 | 420 |
|
419 | 421 | for i, subplot in enumerate(self.subplots):
|
| 422 | + traces = [trace for trace in self.traces if trace['config'].get('subplot', None) == i+1] |
| 423 | + if not traces: |
| 424 | + continue |
| 425 | + else: |
| 426 | + # TODO: include all traces when calculating maxval etc. |
| 427 | + trace = traces[0] |
420 | 428 | for axis in 'x', 'y', 'z':
|
421 |
| - if self.traces[i]['config'].get(axis): |
422 |
| - unit = self.traces[i]['config'][axis].unit |
423 |
| - label = self.traces[i]['config'][axis].label |
424 |
| - maxval = abs(self.traces[i]['config'][axis].ndarray).max() |
| 429 | + if axis in trace['config'] and isinstance(trace['config'][axis], DataArray): |
| 430 | + unit = trace['config'][axis].unit |
| 431 | + label = trace['config'][axis].label |
| 432 | + maxval = np.nanmax(abs(trace['config'][axis].ndarray)) |
425 | 433 | units_to_scale = self.standardunits
|
426 | 434 |
|
427 | 435 | # allow values up to a <1000. i.e. nV is used up to 1000 nV
|
|
0 commit comments