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.

LogLogPlot does not output legends correctly

When I give lists of functions to LogPlot or LogLogPlot with the option of PlotLegends, the output legends only have its first one, just like on the image below.

What should I do to get all legends in the plot?

share|improve this question
    
Evaluate@pdata in the second plot, but you really should make pdata a function... and please, in the future, post code, not images. See the help for information on how. –  rasher May 1 at 9:08
add comment

1 Answer 1

up vote 2 down vote accepted

Using Evaluate for your variable will allow PlotLegends to work. For example:

llist = {1, 2, 3};
pdata = {x, x^2, x^3};
LogLogPlot[Evaluate@pdata, {x, 1, 10}, PlotLegends -> llist]

gives:enter image description here

or

LogPlot[Evaluate@pdata, {x, 1, 10}, PlotLegends -> llist]

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.