2 added 1 character in body
source | link

This is not an answer, but a extended comment on MarcoB's answer, which I think is a good one. However, I would like to suggest aan improvement to the way he plots the fit function together with the data, which makes the plot expression independent of the global variable data.

I am assuming that nlm has been defined precisely as shown in MarcoB's answer.

With[{pts = nlm["Data"]},
  Plot[nlm[x],
    Evaluate @ Prepend[MinMax[pts[[All, 1]]], x], 
    PlotStyle -> {Red, Thick, Dashed}, 
    Epilog -> {PointSize[0.015], Point[pts]}]]

plot enter image description here

This is not an answer, but a extended comment on MarcoB's answer, which I think is a good one. However, I would like to suggest a improvement to the way he plots the fit function together with the data, which makes the plot expression independent of the global variable data.

I am assuming that nlm has been defined precisely as shown in MarcoB's answer.

With[{pts = nlm["Data"]},
  Plot[nlm[x],
    Evaluate @ Prepend[MinMax[pts[[All, 1]]], x], 
    PlotStyle -> {Red, Thick, Dashed}, 
    Epilog -> {PointSize[0.015], Point[pts]}]]

plot enter image description here

This is not an answer, but a extended comment on MarcoB's answer, which I think is a good one. However, I would like to suggest an improvement to the way he plots the fit function together with the data, which makes the plot expression independent of the global variable data.

I am assuming that nlm has been defined precisely as shown in MarcoB's answer.

With[{pts = nlm["Data"]},
  Plot[nlm[x],
    Evaluate @ Prepend[MinMax[pts[[All, 1]]], x], 
    PlotStyle -> {Red, Thick, Dashed}, 
    Epilog -> {PointSize[0.015], Point[pts]}]]

plot enter image description here

1
source | link

This is not an answer, but a extended comment on MarcoB's answer, which I think is a good one. However, I would like to suggest a improvement to the way he plots the fit function together with the data, which makes the plot expression independent of the global variable data.

I am assuming that nlm has been defined precisely as shown in MarcoB's answer.

With[{pts = nlm["Data"]},
  Plot[nlm[x],
    Evaluate @ Prepend[MinMax[pts[[All, 1]]], x], 
    PlotStyle -> {Red, Thick, Dashed}, 
    Epilog -> {PointSize[0.015], Point[pts]}]]

plot enter image description here