I had to make a bar chart of the means of 4 different distributions with error bars in matplotlib where the colours of the bars would change interactively depending on the given Y (mean) value. I used 1.96 for a 95% confidence interval.
stderr = df.std(axis=1)/np.sqrt(n)
norm = Normalize(vmin=-1.96,vmax=1.96)
cmap = get_cmap('PuOr')
Z = (mean.values -y)/stderr.values
normed = norm(Z)
This ensures that the code works as intended. What I would like to know is what exactly is going on when the values in Z:
array([-1.11052123, 2.98511452, 1.0731187 , 9.30156312])
are getting mapped to the values in normed:
masked_array(data=[0.21670377, 1.26150881, 0.77375477, 2.87284774],
mask=False,
fill_value=1e+20)
How exactly is it being mapped? I know from reading the documentation that the values are being mapped to the interval -1.96 to 1.96. What I'd like to know is how exactly 9.30 is mapped to 2.87.
