How do plot (or set) a legend for the 2 curves of this plot ?
Thanks for your support.
Plot[Table[-(10/\[CapitalDelta]t)*
Log[\[CapitalDelta]P], {\[CapitalDelta]P, {2,
4}}], {\[CapitalDelta]t, 1, 60}, PlotLegends -> "Automatic"]
How do plot (or set) a legend for the 2 curves of this plot ?
Thanks for your support.
Plot[Table[-(10/\[CapitalDelta]t)*
Log[\[CapitalDelta]P], {\[CapitalDelta]P, {2,
4}}], {\[CapitalDelta]t, 1, 60}, PlotLegends -> "Automatic"]
Perfect, Thanks a lot, Estevao.
I have always difficulty to find the proper command in Mathematica.
How can we know one needs to use this command/function in this case?
And one more issue why it does not work with LogPlot:
LogPlot[Evaluate[Table[-(10/t)*Log[P], {P, {2, 4}}]], {t, 1, 60},
PlotLegends → {“One”, “Two”}]
In this case, you want to evaluate the Table first and then you need the variable t to plot it. The Evaluate function will run it without t and then the plot function will apply t on it. It is like, Evaluate will hold the equation with a variable (without a numerical result). You can check the documentation: Evaluate—Wolfram Documentation
In the LogPlot case, your function is not helping :).. So, i changed the minus sign to show you that it also works.
y = Table[(10/t)*Log[P], {P, {2, 4}}]
LogPlot[Evaluate@y,{t,1,1000},PlotLegends->{"One","Two"}]
and the result is
Thanks a lot for your support Estevao. Plot appears now exactly as I want.
Great.
Cheers,