Fitting a plot just in a range

Hello, for educational reason, I want to show the experiment to measure the Plank constant to students using LED and Arduino.
I must get a plot like this one

so I’ve to fit just a range of the plot , i.e. Voltage > 1.8V and I wrote
TF1 *fitgraph = new TF1(“fitgraph”, “pol1”, 1.85,3.);

but When I plot, I get the fit of all data…

data_red.txt (384 Bytes) plank.cpp (1.9 KB)

Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

graph->Fit(fitgraph, "R+");

Thank you @Wile_E_Coyote

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.