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

Setting Grid (axes) Below Not Properly Functional #287

@sapphimars

Description

@sapphimars

I am making a corner plot, as so:

fig = corner.corner(
    flat_samples,
    range=[(120, 440), (0.845, 0.853), (0.018, 0.044), (3, 6.6), (0.015, 0.028)],
    quantiles=(0.16, 0.84),
    labels=labels,
    verbose=True,
    color=colors["gray"],
)
ax = np.array(fig.axes).reshape((ndim, ndim))

for i in range(len(ax)):
    for j in range(len(ax)):
        ax[i, j].grid(which="major", color="#CCCCCC")
        # ax[i, j].set_axisbelow(True)
plt.rc("axes", axisbelow=True)

plt.show()

Image

I have also tried the commented out method in order to add gridlines but set them below the data, however the gridlines simply stay above the data. When I make corner plots or plots in general manually, this seems to be entirely functional, so I am opening the issue here. In case its a matplotlib issue, I can open an issue on their github as well, however I am not well versed in the implementation in corner to know the full details of why this is not working here.

Also, not sure if this is a thing, but an option to include the horizontal grid lines on histograms would be nice also, but that is a separate issue. Tick labels on hists would be great but would probably make the resulting figure look cramped based on the style of corner's cornerplots. Could probably figure it out with hist kwargs though, haven't tried it yet.

If anything else is needed, happy to share. I left out some information about the data itself, this is for an assignment and I'm not sure the professor would take kindly to the answer plot being publicly shared lol.

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