Skip to content

Allow categorical variables in smpdf plots

Emanuele Roberto Nocera requested to merge smpdfcategorical into master

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

Loading