def get_mp_error_histogram_plot()

in src/responsibleai/rai_analyse/_score_card/regression_components.py [0:0]


def get_mp_error_histogram_plot(data):
    fig = go.Figure(data=[go.Histogram(y=data["y_error"], nbinsy=10)])
    fig.update_layout(
        paper_bgcolor="rgb(255, 255, 255)",
        plot_bgcolor="rgba(218, 227, 243, 1)",
        margin=dict(l=25, r=25, t=25, b=25),
        width=700,
        height=10 * 70 + 30,
        bargap=0.07,
        xaxis_title_text="Counts",
        yaxis_title_text="Residuals",
    )

    png = pio.to_image(fig)
    png_base64 = base64.b64encode(png).decode("ascii")
    return div(
        img(_src="data:image/png;base64,{}".format(png_base64)), _class="image_div"
    )