Example showing an histogram with reverse axis.
void ReverseXAxis (
TH1 *
h);
void ReverseYAxis (
TH1 *
h);
void reverseaxis()
{
TH2F *hpxpy =
new TH2F(
"hpxpy",
"py vs px",40,-4,4,40,-4,4);
for (
Int_t i = 0; i < 25000; i++) {
}
ReverseXAxis(hpxpy);
ReverseYAxis(hpxpy);
}
void ReverseXAxis(
TH1 *
h)
{
h->GetXaxis()->SetLabelOffset(999);
h->GetXaxis()->SetTickLength(0);
h->GetXaxis()->GetXmin(),
h->GetXaxis()->GetXmax(),
510,"-");
}
void ReverseYAxis(
TH1 *
h)
{
h->GetYaxis()->SetLabelOffset(999);
h->GetYaxis()->SetTickLength(0);
h->GetYaxis()->GetXmin(),
h->GetYaxis()->GetXmax(),
510,"+");
}
void SetLabelOffset(Float_t labeloffset)
virtual void Draw(Option_t *option="")
Draw this histogram with options.
2-D histogram with a float per channel (see TH1 documentation)}
Int_t Fill(Double_t)
Invalid Fill method.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
This is the base class for the ROOT Random number generators.
- Author
- Olivier Couet
Definition in file reverseaxis.C.