BEAST-Fitting / beast

Bayesian Extinction And Stellar Tool
http://beast.readthedocs.io
23 stars 35 forks source link

Modify plot noisemodel and plot_toothpick_detail #702

Closed galaxyumi closed 3 years ago

galaxyumi commented 3 years ago

I made some modification to these two plotting codes to (hopefully) improve figures.

For 'plot_noisemodel', I replaced the 'color' parameter with 'cmap_name' and removed the 'label' parameter. This enables to automatically cycle colors for source density bins for a given color map (default='jet'), as well as to automatically plot a legend for any given number of source density bins.

For 'plot_toothpick_detail', I made the figure size flexiable based on a given number of filters.

lgtm-com[bot] commented 3 years ago

This pull request introduces 1 alert when merging 272796a1a132f8d777ec40c833a6ad11e277d5ab into 4d5fbc1e43a995af0062df6f60c54175b8283617 - view on LGTM.com

new alerts:

christinawlindberg commented 3 years ago

Almost everything looks good to me. The one caveat is that the labels correspond with the order the noise model files are read in, which isn't very informative. E.g. if I gather up the noise model files with glob, the ordering is 0, 1, 10, 11, 12, 2, 3, 4, 5, 6, 7, 8, 9 which then gets labeled as 0, 1, 2, 3, 4, 5... Also, if there are any missing noise files, the labels shift, and it gets kinda confusing. I typically just label them according to the number in the actual file name,

num_label = int(nfile.split(".")[-2].split("bin")[-1])

P.S. One minor thing I noticed is how hard this plot is to create from a command line if there are multiple noise model files. I don't know how often someone wants to run this from the command line though.

galaxyumi commented 3 years ago

Thanks @christinawlindberg. I will make a change in labeling.

Were you even able to make a noisemodel plot from a command line? I tried and failed. Issue #696.

christinawlindberg commented 3 years ago

@galaxyumi I was only able to make it work with one noise model file, which obviously doesn't convey a lot of information...

galaxyumi commented 3 years ago

Almost everything looks good to me. The one caveat is that the labels correspond with the order the noise model files are read in, which isn't very informative. E.g. if I gather up the noise model files with glob, the ordering is 0, 1, 10, 11, 12, 2, 3, 4, 5, 6, 7, 8, 9 which then gets labeled as 0, 1, 2, 3, 4, 5... Also, if there are any missing noise files, the labels shift, and it gets kinda confusing. I typically just label them according to the number in the actual file name,

num_label = int(nfile.split(".")[-2].split("bin")[-1])

@christinawlindberg Thanks for pointing this out. I added new lines to sort the input noisemodel files and use the correct SD bin numbers for labeling.