ROOT Version:_ 6.24/02
Platform:Linux/Fedora 34
Compiler: gcc version 11.3.1 20220421
Hello,
I have generated a 2-D histogram using Histo2D method of RDataFrame. Now, when I try to display the projections with:
auto px = dMultF->ProjectionX("px")->DrawClone();
auto py = dMultF->ProjectionY("py")->SetLineColor(kRed)->DrawClone("same");
I get the following error:
root [0] .x rdf_his2D.cxx+
Info in <TUnixSystem::ACLiC>: creating shared library /home/ajay/./rdf_his2D_cxx.so
In file included from input_line_9:6:
././rdf_his2D.cxx:82:59: error: member reference type 'void' is not a pointer
auto py = dMultF->ProjectionY("py")->SetLineColor(kRed)->Draw("same");
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
Error in <ACLiC>:
However, the following works!
auto px = dMultF->ProjectionX("px")->DrawClone();
auto py = dMultF->ProjectionY("py")->DrawClone("same");
But, then I’m not able to distinguish the two projections. I need the X- and Y-projection histograms in different colors.
auto h_D = dMultF.Histo1D(hmod1D_D, "dTDiff");
auto h_AD = dMultF.Histo1D(hmod1D_AD, "adTDiff");
auto c1 = new TCanvas();
c1->cd();
h_D->DrawClone();
h_AD->SetLineColor(kRed);
h_AD->DrawClone("same");