I am trying to draw a small “kink” in the Y-axis to indicate it does not start from 0
I tried this by creating a different TPad and drawing various TLines (again using BrokenAxis.C by @couet ) and resizing it in the GUI. Is there a more precise/efficient way to do this?
void broken_Y() {
//Canvas and pad (for histograms) creation
TCanvas *c = new TCanvas("c", "c",500,500);
TPad *p1 = new TPad("p1","p1",0.1,0.1,0.9,0.901);
p1->SetBorderMode(0);
p1->Draw();
// Histograms creation
auto myHist = new TH1F("h1","",1000,0,1600);
---
---
// Histograms filling
myHist->Fill();
-----
-----
//Drawing the histograms
p1->cd();
myHist->Draw();
p1->SetLogy();
------
------
//Drawing the kink
c->cd();
TPad *b = new TPad("b","b",0.1,0.19,0.8,0.22);
b->SetBorderMode(0);
b->Draw();
b->cd();
TLine *line = new TLine(0.11,0,0.1105677,0.399656);
line->Draw();
line = new TLine(0.1105677,0.5860092,0.11,1);
line->Draw();
line = new TLine(0.076639,0.5143349,0.1524797,0.6863532);
line->Draw();
line = new TLine(0.076639,0.3423165,0.1524797,0.5143349);
line->Draw();
}