Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: restore handling of labels on multi line plots in matplot #521

Merged
merged 2 commits into from
Mar 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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