How to change the scale of the x axis?

I have a histogram like this:

	TH1F* h = new TH1F("asd","asd",100,0,1000);

how can I change the scale on the x axis?

I want to do something like this…

	h->ChangeXScale(1000);

and now h should be the same as

	TH1F* h = new TH1F("asd","asd",100,0,1);

For example: Lets say the original histogram has on the xaxis energies from 0…1000keV, how can I change the histogram to have on the xaxis 0…1MeV (with same number of bins, actually not changing the underlying data at all)

1 Like
1 Like