Closed jjhw3 closed 1 year ago
Hey @jjhw3 welcome. Could you describe the issue a bit more? I seem to easily be able to write
hs = [hist.new.Reg(10,0,10).Weight().fill(np.random.normal(3+i, 1, 1000)) for i in range(3)]
hep.histplot(hs, histtype='fill', stack=True, color=['red', 'blue', 'firebrick']);
to get the following
Hey @jjhw3 welcome. Could you describe the issue a bit more? I seem to easily be able to write
hs = [hist.new.Reg(10,0,10).Weight().fill(np.random.normal(3+i, 1, 1000)) for i in range(3)] hep.histplot(hs, histtype='fill', stack=True, color=['red', 'blue', 'firebrick']);
to get the following
Hey @andrzejnovak, just after creating the PR, I realised that there was an intended way to do this which was simply had unintended behaviour. While your example works, if you change the color list to a tuple of colors, it would fail. This confused me for quite a while but the fix in this PR is not the right way to do it. Please see my new PR here https://github.com/scikit-hep/mplhep/pull/448 .
Added a 'colors' parameter to histplot to allow users to set histogram colours in the same way as the labels. Before this change, one could not pass one color per histogram without histplot crashing, as all the colors were being passed into ax.stairs as a _kwargs entry.