Setting Grid (axes) Below Not Properly Functional
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 576
- Forks
- 234
- PR merge metrics
- No merged PRs in 30d
Description
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()
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided Python corner.corner example, focusing on ax[i, j].grid(...) and set_axisbelow(True). Inspect how corner.py creates and configures its axes, then verify that gridlines render below plotted data; the histogram horizontal-grid request is separate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100