diff --git a/aiida_kkr/tools/plot_kkr.py b/aiida_kkr/tools/plot_kkr.py index a74caa6d..a5667c2a 100644 --- a/aiida_kkr/tools/plot_kkr.py +++ b/aiida_kkr/tools/plot_kkr.py @@ -1141,12 +1141,14 @@ def make_kkrimp_rmsplot(self, rms_all, stot_all, pks_all, rms_goal, ptitle, **kw # plotting of convergence properties (rms etc.) if len(rms_all) > 0: # sort rms values and flatten array - reorder_rms = array(pks_all).argsort() + reorder_rms = array(pks_all).argsort()[::-1] rms, niter_calcs, stot = [], [0], [] - for i in array(rms_all)[reorder_rms]: + rms_all_sorted = [rms_all[i] for i in reorder_rms] + for i in rms_all_sorted: rms += list(i) niter_calcs.append(len(i) - 0.5) - for i in array(stot_all)[reorder_rms]: + stot_sorted = [stot_all[i] for i in reorder_rms] + for i in stot_sorted: if i is not None: stot += list(i) # now plot