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'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?

share|improve this question
    
Could you post a minimal example ? –  b.gatessucks May 5 '13 at 11:41
add comment

1 Answer 1

up vote 1 down vote accepted

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:

Show[g1,g2]

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

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

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