[bugfix] use only vaild values for plotting

This commit is contained in:
Sebastian Wehling-Benatelli 2016-06-13 11:27:16 +02:00
parent 3568a8a59a
commit 79f0982558
2 changed files with 3 additions and 1 deletions

View File

@ -155,7 +155,7 @@ class Comparison(object):
method = operator.methodcaller(method_name)
pdf_list = self.get_all(phase)
rarray = map(method, pdf_list)
return rarray
return np.array(rarray)
def get_expectation_array(self, phase):
return self.get_array(phase, 'expectation')

View File

@ -238,8 +238,10 @@ class ComparisonDialog(QDialog):
bbox_props = dict(boxstyle='round', facecolor='lightgrey', alpha=.7)
for phase in self.phases:
std = self.data.get_std_array(phase)
std = std[np.isfinite(std)]
stdxlims = [0., 1.2 * max(std)]
exp = self.data.get_expectation_array(phase)
exp = exp[np.isfinite(exp)]
eps_exp = 0.05 * (max(exp) - min(exp))
expxlims = [min(exp) - eps_exp, max(exp) + eps_exp]
axes_dict[phase]['std'].hist(std, range=stdxlims, bins=20, normed=False)