Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have a data set that I am trying to nonlinearfit a model to and then loglogplot the data and the fit.

The data and fit model is:

data={{-1, .2936}, {-1.39794, 0.2781}, {-1.69897, 0.2642}, {-2., 
0.2787}, {-2.39794, 0.2948}}

nlf = NonlinearModelFit[data, 
a + b Log10[x] + c Log10[x]^2, {a, b, c}, x]

This fit yields:


(-0.954007 + 0.352668 I) - (0.112258 + 0.79516 I) Log[x] + 
(0.126554 - 5.25664*10^-16 I) Log[x]^2

How would one LogLogPlot this with the original data set on a real plot? Thanks in advance.

share|improve this question
may be LogLogPlot[Abs@Normal[nlf], {x, 1, 10}] ? this plot the magnitude. If you want only the real or the imaginary plotted, use Im and Re . Is this what you mean? –  Nasser Aug 19 '13 at 3:03
I would rather switch to $-x$ to avoid the imaginary fit function completely. Either by replacing the $x$ in the fit function or transforming the data. –  jenson Aug 19 '13 at 4:13
In answer to Nasser, the data set x coordinates are actually log base 10 of the numbers( .1, .04, .02, ,01, .004). The y coordinates are a ratio of two log base 10 numbers. The student was requested by his professor to fit the model to the log base ten of the x coordinate and the y coordinate , then find the log-log plot of the fit with data set. The request doesn't seem to make sense. –  user9116 Aug 20 '13 at 10:35
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.