corner.py icon indicating copy to clipboard operation
corner.py copied to clipboard

Remove the 1D histograms

Open rustomB opened this issue 4 years ago • 3 comments

I just want the confidence level plot, and hence I am trying to remove the 1D histograms using corner.corner(). Unfortunately I could not do it yet. Can it be done by simply changing any argument?

Thanks in advance.

rustomB avatar May 12 '21 09:05 rustomB

There is no built in feature for this, but I bet you could follow the custom plotting tutorial to extract the relevant axes and clear them manually.

dfm avatar May 12 '21 12:05 dfm

Stumbled upon this thread as I was trying to do the same thing. I managed it in the end like so:

axes = np.array(fig.axes).reshape((ndim, ndim)) for a in axes[np.triu_indices(ndim)]: a.remove()

Just thought I'd share in case that's useful @rustomB .

alex-c-jenkins avatar May 18 '21 14:05 alex-c-jenkins

For anyone who has stumbled upon this thread, you can add bbox_inches='tight' to your plt.savefig() to remove the white padding that's left after removing the axes. Keep in mind that newer versions of matplotlib might require bbox_inches=0.

ChenSun-Phys avatar Dec 20 '22 23:12 ChenSun-Phys