Skip to content

Amend default kwarg behaviour to only over-write specific kwarg in Display classes #5

@lucyleeow

Description

@lucyleeow

Previously, if you passed any curve_kwargs, it would over-ride all default kwargs.

Now, if an individual curve_kwargs that changes the same parameter as a default kwarg is passed, only that parameter will be over-ridden. All other default kwargs will still be used. E.g., if the user set color to red in curve_kwargs, only the defualt color parameter will be over-ridden. The other parameters (e.g., "alpha": 0.5, "linestyle": "--") will still be used.

I think it is more likely that if a user e.g., sets the curve color to be red, they still want the other default kwargs (i.e., they only want to change the color).
In particular, I changed this because it is necessary for precision recall as I think we always want the default "drawstyle": "steps-post" (to prevent interpolation), unless the user specifically changes it.

As discussed in # 30508 this should be separated out into it's own PR.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions