I need to plot an Interpolation function of one independent variable (only a 3kB file) on LogPlot and show the slope of its linear part together on the LogPlot, as manually drawn with a dashed red line in the following figure. But when I Show the LogPlot and a line with the slope of the linear part (see step 3), it turned out to be inconsistent.
import data and plot:
data = <<"...\\data.m"; logPlot = LogPlot[data[t], {t, 0, 2}, PlotRange -> {{0, 2}, {0.01, 30000}}, Frame -> True]
Observe the range of linear part and find a linear fit:
lineardata = Table[Log[data[t]], {t, 1, 1.2, 0.02}]; linearpart = Fit[lineardata, {1, t}, t]; (*0.923913 + 0.689265 t*)Show together with the
linearpart, it was found that thelinearpartdoes not parallel to the linear part of the data onLogPlot.Show[logPlot, LogPlot[Exp[linearpart], {t, 1, 1.2}, PlotStyle -> {Red, Dashed}]]
What's wrong with this? Please help. I have updated the code according to the comments. Thanks for @Roman's suggestion.



LogPlotforlinearparttoo? – Chris K Nov 10 '19 at 10:49LogPlot[Exp[linearpart], ...]– Roman Nov 10 '19 at 11:02data(the interpolating function and the list of values). – Roman Nov 10 '19 at 13:19