1

I have a simple corner plot. Lets just imagine the example from their page (taken from here):

import corner
import numpy as np

ndim, nsamples = 2, 10000
np.random.seed(42)
samples = np.random.randn(ndim * nsamples).reshape([nsamples, ndim])
figure = corner.corner(samples)

Now I want to ask, can I save this full canvas(of 3 plots together) in a single matplotlib figure, so that I may be able to inset this plot in another bigger matplotlib plot.

Additionally I have another question, is there a way to put custom legend/title on corner plots ?

Ayan Mitra
  • 497
  • 1
  • 8
  • 20
  • 1
    No, that is not possible (unless you change [this line](https://github.com/dfm/corner.py/blob/6d8fc763ce64fe57ca4ae4495198676a1c1ea35e/corner/corner.py#L230) in the corner source code to allow for taking figures with more axes as input.) Alternatively, you could produce the corner figure, and add other axes later on. – ImportanceOfBeingErnest Feb 20 '20 at 11:24

1 Answers1

1

this is my first post on Stack Overflow, with less than 50 reputation I cannot post this as a comment, hope it is helpful to some extent.

Using this line to save the figure of corner plots:

corner.corner.savefig('cornerplot...')

Perhaps this is adjustable and can be reloaded as matplotlib subplot objects. Though understanding the source code would certainly be best