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
Comments
Post a Comment