1
$\begingroup$

This question already has an answer here:

I have a function with two independent variables:

SNR[t_, f_] := 20 Log10[1/(2 Pi f t)]

And I have a list for "t"

tlist = {0.1*10^-12, 1*10^-12, 10*10^-12, 100*10^-12, 1*10^-9};

Then I use the code below to plot the functions:

LogLinearPlot[Table[SNR[t, f], {t, tlist}], {f, 1*10^6, 100*10^6}, Frame -> True, GridLines -> Automatic, FrameLabel -> {"f(Hz)", "SNR(dB)"}, PlotLabel -> "SNR vs f for Different Jitter Values"]

The lines are plotted, but all the lines are in the same color. Is there a method to make the lines are drawn with different colors?

$\endgroup$

marked as duplicate by Karsten 7., Yves Klett, Michael E2, Öskå, Jens Dec 23 '14 at 19:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ You should add Evaluate before table $\endgroup$ – funnyp0ny Dec 23 '14 at 9:44
  • $\begingroup$ You mean that I need put the Table[] into Evaluate[]? I do it, but warnings are popped out. $\endgroup$ – diverger Dec 23 '14 at 9:49
  • $\begingroup$ Yes, thats it. What kind of warnings? $\endgroup$ – funnyp0ny Dec 23 '14 at 9:51
  • $\begingroup$ Table::iterb: "Iterator {t,tlist} does not have appropriate bounds." $\endgroup$ – diverger Dec 23 '14 at 9:52
  • $\begingroup$ Just to be sure, does this example raise error too or not: LogLinearPlot[Evaluate@Table[SNR[t, f], {t, tlist}], {f, 1*10^6, 100*10^6}] $\endgroup$ – funnyp0ny Dec 23 '14 at 10:03
2
$\begingroup$

This works

SNR[t_, f_] := 20 Log10[1/(2 Pi f t)]
tlist = {0.1*10^-12, 1*10^-12, 10*10^-12, 100*10^-12, 1*10^-9};
LogLinearPlot[Evaluate@Table[SNR[t, f], {t, tlist}], {f, 1*10^6, 100*10^6},  Frame -> True, GridLines -> Automatic,  FrameLabel -> {"f(Hz)", "SNR(dB)"}, PlotLabel -> "SNR vs f for Different Jitter Values"]

Check Wolfram announcement on PlotThemes here

$\endgroup$

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