[hist] Allow to customize pads layout for THStack and TMultiGraph#20819
[hist] Allow to customize pads layout for THStack and TMultiGraph#20819hageboeck merged 2 commits intoroot-project:masterfrom
Conversation
When using PADS drawing option, now one can add number specyfiing number of columns for new pads layout. Rows will be calculated autmatically.
|
a bit related: #20770 |
hageboeck
left a comment
There was a problem hiding this comment.
Hello @rlalik,
that's a great initiative, thank you!
I added a few comments below, please let me know what you think.
Finally, because now we are touching it, would you agree that a short paragraph about the PADS drawing option would make sense for TMultiGraph? One could add it maybe to the TMultiGraph documentation. What do you think?
I added short documentation to |
Implementation of review suggestions plus extra documentation.
Test Results 22 files 22 suites 3d 21h 3m 56s ⏱️ Results for commit 8c455c5. ♻️ This comment has been updated with latest results. |
|
Need to close to rebase in the CI |
|
I add support of https://jsroot.gsi.de/dev/?file=../files/tutorials_hist.root&item=multicolor&opt=pads3 |
When using
PADSdrawing option, now one can add number specyfiing number of columns for new pads layout. Rows will be calculated autmatically.Some examples:
When changing the last but one line to:
and backward comaptibility:
Same for graphs:
{ auto mg = new TMultiGraph(); auto gr1 = new TGraph(); gr1->SetMarkerStyle(20); auto gr2 = new TGraph(); gr2->SetMarkerStyle(21); auto gr3 = new TGraph(); gr3->SetMarkerStyle(23); auto gr4 = new TGraph(); gr4->SetMarkerStyle(24); Double_t dx = 6.28/100; Double_t x = -3.14; for (int i=0; i<=100; i++) { x = x+dx; gr1->SetPoint(i,x,2.*TMath::Sin(x)); gr2->SetPoint(i,x,TMath::Cos(x)); gr3->SetPoint(i,x,TMath::Cos(x*x)); gr4->SetPoint(i,x,TMath::Cos(x*x*x)); } mg->Add(gr4,"PL"); mg->Add(gr3,"PL"); mg->Add(gr2,"*L"); mg->Add(gr1,"PL"); mg->Draw("A pmc plc pads3"); }This does not work with
--web=on(Web Canvas) but I am not good enough in JS to fix that. ButPADSseems to not work nicely with the web interface anyway. Perhaps it could be fixed -PADSin general andPADSnfor this PR. @linev could you help with that?Checklist:
This PR fixes #