Skip to content

allow injecting axes into plotting functions #142

Open
@lukasheinrich

Description

@lukasheinrich

sometimes it's useful too have a pattern in which you can explicitly pass in axes to plot on. This can be useful when trying to compose multiple visualizations into subplots

image

in pyhf I'd like to introduce the following pattern:

import numpy as np
import matplotlib.pyplot as plt

def plot_results(mutests, tests, test_size=0.05, ax = None):
    """Plot a series of hypothesis tests for various POI values."""
    ax = ax or plt.gca()
    ....
    return ax

saving will still be easy:

image

Happy to work / PR this is that seems useful

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions