WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

overplot_lines fails when the dataset is one-dimensional #300

@jagerber48

Description

@jagerber48

When I call overplot_lines with a 1D dataset I get an error like

...
(.../corner/core.py#line=846), in overplot_lines(fig, xs, reverse, **kwargs)
    845 for k1 in range(K):
    846     if xs[k1] is not None:
--> 847         axes[k1, k1].axvline(xs[k1], **kwargs)
    848     for k2 in range(k1 + 1, K):
    849         if xs[k1] is not None:

TypeError: 'Axes' object is not subscriptable

For multi-dimensional data I have code that draws crosshairs on best fit points on the 2D plots and it plots confidence interval lines on the histograms at the top of each column. When I call corner plot on a 1D dataset I see the histogram. I want my code to also work to add the confidence interval lines on the histogram without needing to special case this case.

Instead of giving this exception I would prefer if overplot_lines check if the data is 1D, and if so, do nothing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions