Skip to content

Setting Grid (axes) Below Not Properly Functional #287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sapphimars opened this issue Jan 24, 2025 · 0 comments
Open

Setting Grid (axes) Below Not Properly Functional #287

sapphimars opened this issue Jan 24, 2025 · 0 comments

Comments

@sapphimars
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant