Skip to content

negative yerr not handled by cabinetry.visualize.data_mc #388

@rmnmllr

Description

@rmnmllr

Probably a minor issue and more of a error handling request, but while trying to visualize the prefit plots I receive an error from matplotlib that yerr can't contain negative values:

Traceback (most recent call last):
  File "/terabig/muellerr/Leptoquarks/fitting/run_cabinetry.py", line 333, in <module>
    run_cabinetry(args["inputs"], args["variables"], args["couplings"], gen_input, plot, limit, ranking, args["signi"])
  File "/terabig/muellerr/Leptoquarks/fitting/run_cabinetry.py", line 178, in run_cabinetry
    cabinetry.visualize.data_mc(prediction_prefit, data, config=config, figure_folder=figurespath, log_scale=True, close_figure=True)
  File "/terabig/muellerr/.conda/envs/fit/lib/python3.9/site-packages/cabinetry/visualize/__init__.py", line 236, in data_mc
    fig = plot_model.data_mc(
  File "/terabig/muellerr/.conda/envs/fit/lib/python3.9/site-packages/cabinetry/visualize/plot_model.py", line 174, in data_mc
    ax2.errorbar(
  File "/terabig/muellerr/.conda/envs/fit/lib/python3.9/site-packages/matplotlib/__init__.py", line 1423, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "/terabig/muellerr/.conda/envs/fit/lib/python3.9/site-packages/matplotlib/axes/_axes.py", line 3587, in errorbar
    raise ValueError(
ValueError: 'yerr' must not contain negative values

This is probably related to few statistics in the selected region, but can this be logged and or be catched somewhere?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions