Error when trying to specify TGraph Fit range

Hello, I have three data sets that I am plotting in a multigraph and I need to fit each one. When I do the fit, the fit line seems to use the entire x range of the window instead of just the range occupied by the data points. Each individual graph does not necessarily span the same x range as the others. So what I would like to do is specify in each fit, the range of the fit but when I do so, I get an error. It will not run, but here is where I am getting the error.

let array1 and array2 be the x and y value arrays, respectively. I am using pyroot by the way. Then:

gr = ROOT.TGraph(len(array1), array1, array2)
gr.Fit('pol1', 'f', xmin = min(array1), xmax = max(array1))

The resulting error is:

TypeError: none of the 2 overloaded methods succeeded. Full details:
keyword arguments are not yet supported
keyword arguments are not yet supported

I have tried putting in the exact numerical values instead of using min/max. I have also tried ordering each option perfectly but nothing seems to work. When I run it just as

gr.Fit('pol1', 'f')

it works fine but with the extended fit range.

Any help is appreciated! I guess another question is, is the fit function only using the range of data available, then just drawing across the whole page? Thanks!

ROOT Version: 6.12/06
Platform: Ubuntu 18.04
Compiler: Not sure

Did you try

Yes, when I do that, I get:

TypeError: none of the 2 overloaded methods succeeded. Full details:
TFitResultPtr TGraph::Fit(const char* formula, const char* option  = "", const char* goption = "", double xmin = 0, double xmax = 0) =>could not convert argument 3 (expected string or Unicode object, float found)

I think that means it does not like me putting an xmin where goption is supposed to be? I tried doing

gr.Fit('pol1', f, goption = '', min(array1), max(array1))

too but that did not work either.

then try:

gr.Fit('pol1', f, "", min(array1), max(array1))

Wow, I thought I had tried that but I guess I did not. It worked! Thank you!