# Why doesn't Mathematica completely draw the fit?

I have a question, and I really need your help, because I think I'm not understanding the reason...

I have a potential model..

F[x_] := k x^n


for the next graphic...

the fits shows a error and it doens't draw the curve completly...

NonlinearModelFit::sszero: The step size in the search has become less than the tolerance prescribed by the PrecisionGoal option, but the gradient is larger than the tolerance specified by the AccuracyGoal option. There is a possibility that the method has stalled at a point that is not a local minimum.

data2={{0.000205, 81.41}, {0.000422, 58.14}, {0.00144, 30.51}, {0.00198,25.93}, {0.00396, 18.98}, {0.00485, 16.83}}


and and I used this...

FindFit[data2, F[x], {k, n}, x]

• Provide the code (copy and paste form) and the data that you used. Jun 13, 2019 at 18:23
• try using explicit plot range: Plot[Evaluate[F[x] /. FindFit[data2, F[x], {k, n}, x]], {x, 0, .006}, PlotRange -> {{0, .006}, {0, 90}}, Epilog -> {Red, PointSize[Large], Point@data2}]?
– kglr
Jun 13, 2019 at 18:52

Add the option PlotRange (say PlotRange -> {{0, .006}, {0, 90}}), and

use data2 as Epilog:

Plot[Evaluate[F[x] /. FindFit[data2, F[x], {k, n}, x]], {x, 0, .006},
PlotRange -> {{0, .006}, {0, 90}},
Epilog -> {Red, PointSize[Large], Point@data2}]


Alternatively, use Plot first in Show:

Show[Plot[Evaluate[F[x] /. FindFit[data2, F[x], {k, n}, x]], {x, 0, .006},
PlotRange -> {{0, .006}, {0, 90}}],
ListPlot[data2, PlotStyle -> Directive[Red, PointSize[Large]]]]


same picture

• thanks a lot @kglr, it was very helpfull :) Jun 13, 2019 at 19:42
• @ChrisSchwenke, my pleasure. Thank you for the accept.
– kglr
Jun 13, 2019 at 20:01