From 03e0e381362963a91dc3f0326447551a8edd97ad Mon Sep 17 00:00:00 2001 From: Michal Nowak <albeercik@gmail.com> Date: Fri, 13 Nov 2015 12:03:12 +0100 Subject: [PATCH] correct pos_transform so it affects the size of the symbols --- kwant/plotter.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kwant/plotter.py b/kwant/plotter.py index 42ba2bfb..913f24cd 100644 --- a/kwant/plotter.py +++ b/kwant/plotter.py @@ -1156,6 +1156,12 @@ def plot(sys, num_lead_cells=2, unit='nn', end_pos = resize_to_dim(end_pos) start_pos = resize_to_dim(start_pos) + # Apply transformations to the data + if pos_transform is not None: + sites_pos = np.apply_along_axis(pos_transform, 1, sites_pos) + end_pos = np.apply_along_axis(pos_transform, 1, end_pos) + start_pos = np.apply_along_axis(pos_transform, 1, start_pos) + # Determine the reference length. if unit == 'pt': reflen = None @@ -1187,12 +1193,6 @@ def plot(sys, num_lead_cells=2, unit='nn', except: raise ValueError('Invalid value of unit argument.') - # Apply transformations to the data - if pos_transform is not None: - sites_pos = np.apply_along_axis(pos_transform, 1, sites_pos) - end_pos = np.apply_along_axis(pos_transform, 1, end_pos) - start_pos = np.apply_along_axis(pos_transform, 1, start_pos) - # make all specs proper: either constant or lists/np.arrays: def make_proper_site_spec(spec, fancy_indexing=False): if callable(spec): -- GitLab