diff --git a/src/nexusformat/nexus/plot.py b/src/nexusformat/nexus/plot.py index e024299..d6842fc 100644 --- a/src/nexusformat/nexus/plot.py +++ b/src/nexusformat/nexus/plot.py @@ -194,8 +194,8 @@ def plot(self, data_group, fmt=None, xmin=None, xmax=None, fmt = kwargs.pop('marker') else: fmt = 'o' - if hasattr(signal, 'units'): - if not errors and signal.units == 'counts': + if 'units' in signal.attrs: + if not errors and signal.attrs['units'] == 'counts': errors = NXfield(np.sqrt(data)) if errors: ebars = errors.nxdata