Skip to content

Commit

Permalink
Fix: restore handling of labels on multi line plots in matplot (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshnielsen authored and giulioungaretti committed Mar 13, 2017
1 parent 4651e11 commit 50c46c7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions qcodes/plots/qcmatplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit 50c46c7

Please sign in to comment.