joshspeagle / dynesty

Dynamic Nested Sampling package for computing Bayesian posteriors and evidences
https://dynesty.readthedocs.io/
MIT License
346 stars 76 forks source link

Questions about dyplot.cornerplot #458

Closed Sunnnsh closed 9 months ago

Sunnnsh commented 9 months ago

Hi, I'm sorry to bother you. I want to ask about dyplot.cornerplot. How can I plot the results of two dynesty runs on a single corner plot using dynesty.cornerplot? How can I make the central region not filled with color? 微信图片_20231107152134 and or make them color-filled with levels as shown in the following figure? 微信图片_20231107152255

joshspeagle commented 9 months ago

So at its core, dynesty.plotting.cornerplot passes certain arguments (here the relevant one is the hist2d_kwargs at the corresponding API) through to other plotting internals to plot up the (smoothed) 1-D and 2-D histograms. The _hist2d method for the 2-D contours can be found here, which describes what options are theoretically available to change the settings on these.

Sunnnsh commented 9 months ago

Thank you very much! I have two dynesty results, how can I use dynesty.plotting.cornerplot to plot them on one corner plot? I have tried using a loop, but it doesn't work.

joshspeagle commented 9 months ago

You should get the fig, axes objects returned as part of the cornerplot method call. You should be able to feed one/both (I forget the exact syntax) back in as an argument to a future plotting call, which will then overplot the results on the same figure.

Sunnnsh commented 9 months ago

Thank you!