I’m trying to plot some data points with alphanumeric expressions on the x axis. I followed example hlabels2.C but it just doesn’t work:
const int n = 3;
double par1[n] = {x1,x3,x4}; // x1,x3,x4 are parameter that were evaluated before in the macro
char *date[n] = {“April”,“Mid July”,“End of Sept”};
TH2F *h = new TH2F(“h”,“variation of center position”,3,0,3,10,0,10);
h->SetBit(TH1::kCanRebin);
h->SetStats(0);
for(int i=1;i<4;i++) {
h->Fill(date[i],par1[i]);
}
h->LabelsDeflate();
h->LabelsOption(“v”);
h->Draw(“text”);
gives: Warning in TH2F::LabelsOption: Cannot sort. No labels
help, please!
cheers,
Kati