Allow categorical variables in smpdf plots
Created by: Zaharid
Fix crash in plot_smpdf when the variable in the color axis is categorical, such as for the W and Z total cross sections. Encode the categorical variables as integers and use an appropriate color map to display them.
The implementation feels a bit untidy, with some variables acting at a distance, but there doesn't seem to be an easy better way considering that we'd like the color bar to be the same for all figures.
Also, the fact that np.unique sorts the output may not be what we want. See https://github.com/numpy/numpy/issues/8621. But don't want to make it more complicated.
Merge request reports
Activity
requested review from @enocera
Created by: Zaharid
See result here https://vp.nnpdf.science/kqbWu8OWQum14sMYRegLAg==/#atlas_wz_tot_13tev
Created by: RoyStegeman
Review: Commented
np.unique
seems fine to me. At the moment I don't imagine the order matters very much so as long asnp.unique
keeps things consistent I couldn't care less.Did you mean to have a different figure for the Ws and Z?
Also, there are double parentheses due to
group_label
and the title both adding them.