I'm plotting multiple lists with ListPlot[] or ListLogPlot[]:

ListLogPlot[{ListA, ListB, ListC, ListD, ListE}, PlotRange -> {{0, 100}, Automatic}]

I also have fits, $(f_a,f_b,f_c,f_d,f_e)$ for the data in each of the lists. How can I overlay the fits in the same color and for the same $(x,y)$ range?

  • $\begingroup$ Could you post a minimal example ? $\endgroup$ – b.gates.you.know.what May 5 '13 at 11:41

Create some data:

data = Map[Sin[# Range@100] + # &, {1, 5, 3, 6}] // N;

Create some fits:

fits = LinearModelFit[#, g, g] & /@ data;

Plot the data:

g1 = ListLogPlot[data, PlotRange -> {{0, 100}, Automatic}, Joined -> True];

Plot the fits:

g2 = ListLinePlot[Log@Thread[#[Range[0, 100]]]& /@ fits, PlotRange->{{0, 100},Automatic}]

Combine the plots:


enter image description here

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.