No axis (nor labels neither divisions) drawn when running macro

Hi all,

I am having an issue regarding the axis. I run my macro and no axis is drawn , just the frame of the plot, what should I add?

{
    TFile f1("run1/zcr_data_irr_e.root");
    TH1 *ff_data_irr = (TH1*)f1.Get("ff1");
    TFile f2("run1/zcr_data_irr_ttb_e.root");
    TH1 *ff_data_irr_ttb = (TH1*)f2.Get("ff1");
    TCanvas *c4 = new TCanvas("c4","c4");
    ff_data_irr->SetMinimum(0);
    ff_data_irr->SetMaximum(1.3);
    ff_data_irr->SetMarkerStyle( kCircle);
    ff_data_irr->SetMarkerColor(kRed);
    ff_data_irr->SetLineColor(kRed);
    ff_data_irr->Draw("AP");
    ff_data_irr->GetYaxis()->SetLabelSize(0.05);
    ff_data_irr_ttb->SetMarkerStyle(kFullCircle);
    ff_data_irr_ttb->Draw("APSAME");
    
    TLegend * legSyst = new TLegend(0.55,0.75,0.95,0.9);
    legSyst->SetTextSize(0.04);
    legSyst->SetNColumns(1);
    legSyst->AddEntry(ff_data_irr, "data - irr","lp");
    legSyst->AddEntry(ff_data_irr_ttb, "data -irr-ttbar","lp");    
    legSyst->Draw();
    c4->Modified();
}

Thanks!

Cheers,
Des

Actually you do not need to add something but to remove something: The option “A”.


    ff_data_irr->Draw("P");

    ff_data_irr_ttb->;Draw("P SAME")

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.