I am having trouble with adding a legend to a plot. The example I discuss here is simpler than my real problem, but describes it well.
I have a vector, called X with dimensions (100 x 6). I use the command ListPlot
to plot one row of X at a time:
plotX={};
Do[
p1=ListPlot[X[[i]]];
AppendTo[plotX,p1],
{i,1,Length[X]}];
Therefore, the list plotX
contains six list plots with 100 points each. To show all the plots, I use the command Show
Show[plotX]
Now I want to create a legend for this graph, for example {"x1","x2","x3","x4","x5","x6"}
. How can I do this?
Thanks
PlotLegends
option. $\endgroup$PlotLegends
work in version 7 too, in fact sometimes I used it, but in this case I can't to resolve the problem with that command $\endgroup$PlotLegends
in your version. $\endgroup$Plot[{Sin[x], Cos[x]}, {x, 0, 2 Pi}, PlotLegend -> {"sine", "cosine"}]
I have no problem, but in my example gives me error and a message: An unr"ecognized option name ("PlotLegends`PlotLegend") was encountered while reading a GraphicsBox." $\endgroup$