Generating histograms from functions

Hi,

I’m generating a 1D histogram from a 1D user-defined function, so I’ve written:

 TF1 *f1 = new TF1 ("f1", "1/((x-[0])^2+([1]/2)^2)", -5., 5.);
  f1->Draw();
  (f1->GetHistogram())->Draw();

This works fine except I want to control the number of bins which the function is spread over. At the moment the function is spread over about 15 bins, but I’d like it to be devided into about 50 bins. How do I get more control over this Histogram?

I’m using version 4.01/02.

Thank you,
Kim

f1->SetNpx(50);

should make it