FAST-HEP / fast-plotter

Manipulate binned pandas dataframes into plots
https://fast-hep.web.cern.ch
3 stars 8 forks source link

Regex comparison issue when using Latex notation #74

Open GluonicPenguin opened 1 year ago

GluonicPenguin commented 1 year ago

If marking signal contributions using Latex e.g. including backslashes, cannot generate this in the plot given this regex comparison line (https://github.com/FAST-HEP/fast-plotter/blob/master/fast_plotter/utils.py#L77) will raise an error re.error: bad escape \X at position Y.

Workaround is to manually append latex-formatted string to the first_values array, with double-backslashes. This is due to the known re.match issue when including "\" in string.