From 2273f938cd224bb0d8143d0bd23f2b06b6b64f9e Mon Sep 17 00:00:00 2001 From: Jens Hedegaard Nielsen Date: Mon, 13 Mar 2017 10:05:34 +0100 Subject: [PATCH] Fix: restore handling of labels on multi line plots in matplot --- qcodes/plots/qcmatplotlib.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/qcodes/plots/qcmatplotlib.py b/qcodes/plots/qcmatplotlib.py index 128ec27accf..7f0aa1fb06f 100644 --- a/qcodes/plots/qcmatplotlib.py +++ b/qcodes/plots/qcmatplotlib.py @@ -126,13 +126,19 @@ def _update_labels(self, ax, config): # the data array inside the config getter = getattr(ax, "get_{}label".format(axletter)) if axletter in config and not getter(): - # now if we did not have any kwark gor label or unit + # now if we did not have any kwarg for label or unit # fallback to the data_array - if unit is None: + if unit is None: _, unit = self.get_label(config[axletter]) if label is None: label, _ = self.get_label(config[axletter]) - + elif getter(): + # The axis already has label. Assume that is correct + # We should probably check consistent units and error or warn + # if not consistent. It's also not at all clear how to handle + # labels/names as these will in general not be consistent on + # at least one axis + return axsetter = getattr(ax, "set_{}label".format(axletter)) axsetter("{} ({})".format(label, unit))