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

Plot two datasets together

Open alessandropeca opened this issue 5 years ago • 4 comments

Is it possible to plot together (with different colors) two different data sets? I think it could be very useful to show the differences in two datasets.

alessandropeca avatar Mar 27 '20 17:03 alessandropeca

You can do that using the fig argument:

fig = corner.corner(dataset1, ..., color="C0", weights=np.ones(len(dataset1))/len(dataset1))
corner.corner(dataset2, ..., color="C1", fig=fig, weights=np.ones(len(dataset2))/len(dataset2))

If you have different numbers of points you'll need to use the weights argument to re-weight the points to get the same normalization as above, but you can leave that off if they are the same size.

dfm avatar Mar 27 '20 19:03 dfm

Thank you!

alessandropeca avatar Mar 27 '20 22:03 alessandropeca

Hi guys, This is an old one, but since it is not closed, I decided to ask my question here, instead of opening a new issue. So, I found this feature to be very useful, and I have succeeded in using it. Now, however, I'm interesting in getting a corner plot with, say, two datasets but with different number of (constrained) parameters, e.g., [a,b,c] for one dataset and [b,c] for the other. So my question is, is there a way to make such a combination? Here is an example of what I have in mind, in case I'm not clear enough with my description above. cornerplot

Thanks, Mario AAO

maaceroo avatar Apr 04 '24 14:04 maaceroo