You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used BAT 1.0.0-RC1 for an unfolding paper (arXiv:1808.01930). However, the plots showing the prior update have a really low quality, the labels are too small and there is no way to tell the difference between the two histograms if printed b/w. How do I change the style of this plot without recompiling BAT from scratch? Shouldn't the default style be prettier (and easily recognizable as "BAT-like") in any case?
There's no configuration files or so (though playing with the ROOT plot style defaults may work). But on the plus side, compiling BAT doesn't take very long. ;-)
Regarding the default style/quality of the plots, a PR with improvments will of course be welcome.
I'm trying to work out some changes so that the prior appears as a grey filled histogram, and the posterior is represented by black dots. I'll let you know what I changed as soon as I get something decent so I can make a pull request.
I think I obtained something I like more. It was also partially my fault. Switching on BCAux::SetStyle() improved things a lot, I recommend to make it the default mode. Then, I also realized that I was using an older version of BAT. Pulling a newer version from GIT fixed a few more thing such as the position of the legend.
I modified BCAux.cxx to make the prior histogram filled. When printed b/w, the grey line is hard to distinguish from the posterior.
You can find in attachment an example of how it looks like now.
I believe this is similar (if not identical) to what BAT currently produces. @rdisipio, please consider using the most up-to-date version of BAT. This is currently version 1.0. Many changes were made to the drawing style between 1.0.0-RC1 and 1.0.0 to adapt to changes in ROOT. In version 1.0 BCAux::SetStyle() is an empty dummy function included only for backwards compatibility. All basic style choices are set through the normal ROOT interface.
long story short: the style is greatly improved, I like it! However, I got the preprint rejected again because the size of the labels of the axes and of the legend is too small. Since they did not complain about other plots, it seems that setting it to 0.06 (or larger) should make the editors happy.
coming back to this issue. As I said, I think the style was greatly improved, but I need to make the text larger. I'm quite lost inside BCAux.cxx . Any suggestion where to change the code? For example, I tried to add (without success) the following lines to src/BCAux.cxx :
The problem is that these are the options stored in dummy BCH1D's; they are handed off to the individual BCH1D's that are drawn via BCHistogramBase::CopyOptions(...). And this does not copy the options from the histogram itself, since ROOT has no such functionality built in, unfortunately.
Your best option is to communicate with ROOT directly. Before calling the function to draw the knowledge update plots, ask ROOT to increase the title size: gStyle->SetTitleSize(1.). I can't verify that will work, but something like that should.
Is there an option to save all the histograms to a ROOT file, so I can read them after they are created and plot them with my own macro?
I can call the function BCEngineMCMC::WriteMarginalizedDistributions(), but that only writes out the posteriors. I can access the priors only from the derived class BCModel::GetPrior().
Hi,
ok so I've found a workaround. I added a function to my derived class to save a ROOT file containing TH1Ds and TH2Ds for priors and marginalized posterior distributions. This way, I can create an external script to create the plots. While this is a solution for me, you may want to consider implementing a similar function in BCModel.
Activity
oschulz commentedon Sep 25, 2018
There's no configuration files or so (though playing with the ROOT plot style defaults may work). But on the plus side, compiling BAT doesn't take very long. ;-)
Regarding the default style/quality of the plots, a PR with improvments will of course be welcome.
rdisipio commentedon Sep 25, 2018
Hi,
I'm trying to work out some changes so that the prior appears as a grey filled histogram, and the posterior is represented by black dots. I'll let you know what I changed as soon as I get something decent so I can make a pull request.
Cheers,
Riccardo
oschulz commentedon Sep 26, 2018
CC @fredRos, @greenwald
rdisipio commentedon Sep 26, 2018
Hi,
I think I obtained something I like more. It was also partially my fault. Switching on BCAux::SetStyle() improved things a lot, I recommend to make it the default mode. Then, I also realized that I was using an older version of BAT. Pulling a newer version from GIT fixed a few more thing such as the position of the legend.
I modified BCAux.cxx to make the prior histogram filled. When printed b/w, the grey line is hard to distinguish from the posterior.
You can find in attachment an example of how it looks like now.
Cheers,

Riccardo
BCAux.cxx.txt
oschulz commentedon Sep 26, 2018
Hm, @greenwald , what do you think?
greenwald commentedon Oct 11, 2018
I believe this is similar (if not identical) to what BAT currently produces. @rdisipio, please consider using the most up-to-date version of BAT. This is currently version 1.0. Many changes were made to the drawing style between 1.0.0-RC1 and 1.0.0 to adapt to changes in ROOT. In version 1.0
BCAux::SetStyle()is an empty dummy function included only for backwards compatibility. All basic style choices are set through the normal ROOT interface.rdisipio commentedon Oct 23, 2018
Hi,
long story short: the style is greatly improved, I like it! However, I got the preprint rejected again because the size of the labels of the axes and of the legend is too small. Since they did not complain about other plots, it seems that setting it to 0.06 (or larger) should make the editors happy.
How do I change that in the code?
rdisipio commentedon Nov 19, 2018
Hi,
coming back to this issue. As I said, I think the style was greatly improved, but I need to make the text larger. I'm quite lost inside BCAux.cxx . Any suggestion where to change the code? For example, I tried to add (without success) the following lines to src/BCAux.cxx :
greenwald commentedon Nov 19, 2018
The problem is that these are the options stored in dummy
BCH1D's; they are handed off to the individualBCH1D's that are drawn viaBCHistogramBase::CopyOptions(...). And this does not copy the options from the histogram itself, since ROOT has no such functionality built in, unfortunately.Your best option is to communicate with ROOT directly. Before calling the function to draw the knowledge update plots, ask ROOT to increase the title size:
gStyle->SetTitleSize(1.). I can't verify that will work, but something like that should.rdisipio commentedon Nov 19, 2018
Is there an option to save all the histograms to a ROOT file, so I can read them after they are created and plot them with my own macro?
I can call the function BCEngineMCMC::WriteMarginalizedDistributions(), but that only writes out the posteriors. I can access the priors only from the derived class BCModel::GetPrior().
rdisipio commentedon Nov 20, 2018
Hi,
ok so I've found a workaround. I added a function to my derived class to save a ROOT file containing TH1Ds and TH2Ds for priors and marginalized posterior distributions. This way, I can create an external script to create the plots. While this is a solution for me, you may want to consider implementing a similar function in BCModel.
Thanks for helping out!
Best,
Riccardo
greenwald commentedon Nov 20, 2018
You can save the samples in a
TTreeand then draw them in any way you wish.