FIT3170-FY-Project-7 / RABIT-COMMON

Common repository of the RABIT project, for documentation storage and cross-component interaction.
https://rabit2022.cloud.edu.au/plots
ISC License
3 stars 1 forks source link

Make corner plot more bilby-esk #13

Open avivajpeyi opened 2 years ago

avivajpeyi commented 2 years ago

I asked Paul after the meeting if he had some thoughts no plot-aesthetics. This is what he said:

I do have strong feelings on plots :sweat_smile: I guess it depends how deep their willing to go. To be honest, if in the first instance they can get the plots looking like Bilby plots it would be amazing. After that you'd want to provide the user functionality to change a whole range of things, but defaulting to Bilby would be a great start...

I think I can break this down a bit for yall. To start, lets compare RABIT vs Bilby corner plots:

RABIT Bilby
RABIT Bilby

Code to generate this below:

# ! pip install bilby --quiet

import numpy as np
from bilby.core.result import Result
import matplotlib.pyplot as plt

N = 10000
fake_data = dict(m1=np.random.normal(50,5,N), m2=np.random.normal(35,5,N))
bilby_result = Result()
bilby_result.posterior = pd.DataFrame(fake_data)
bilby_result.search_parameter_keys = list(fake_data.keys())
bilby_result.parameter_labels_with_unit = [r"$m_1\ [M_{\odot}]$",r"$m_2\ [M_{\odot}]$"]
fig = bilby_result.plot_corner(save=False)
fig.savefig("bilby.png", dpi=300)
avivajpeyi commented 2 years ago

Note that I think this mainly because Paul may be thinking about the plot download feature.

Comparing the plots, these are some things that I notice that paul may be thinking about

Python code to get the [median+/-90%] used in the title: https://git.ligo.org/lscsoft/bilby/-/blob/master/bilby/core/result.py#L865