I am using the hatched area (style 3144) to represent the represent the errors.
And I want to have the same spaces between lines in two pads of different size.
By default, they are not.
I’ve tried gStyle->SetHatchesSpacing but it doesn’t work for me.
The code is the following:
gStyle->SetOptStat(0);
gStyle->SetHatchesSpacing(16);
TCanvas *can = new TCanvas("can","can", 1000, 400);
TPad *pad1 = new TPad("pad1","p1", 0, 0, 0.2, 1);
TPad *pad2 = new TPad("pad2","p2", 0.2, 0.0, 1, 1);
pad2->SetRightMargin(0.7);
pad1->Draw();
pad2->Draw();
TH1D *h[2];
for(int i = 0; i < 2; ++i) {
h[i] = new TH1D(TString::Format("h%d",i), "", 1, -5, 5);
h[i]->SetBinContent(1, 1);
h[i]->SetBinError(1, 0.4);
h[i]->SetFillColor(kOrange);
h[i]->SetFillStyle(3144);
h[i]->GetXaxis()->SetLabelFont(43);
h[i]->GetYaxis()->SetLabelFont(43);
h[i]->GetXaxis()->SetLabelSize(10);
h[i]->GetYaxis()->SetLabelSize(10);
}
pad1->cd();
h[0]->Draw("e2");
pad2->cd();
h[1]->Draw("e2");
The result looks like this and I want to have the same hatching style in both frames.
