Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Legend for combined plot' topicStudent Support Forum > General > "Legend for combined plot"

Next Comment >Help | Reply To Topic
Author Comment/Response
Nike Dattani
12/18/11 10:05pm

Greetings!
I'd love to be able to make a legend for the following figure:
=============================
{aa, a} = Timing[Plot[x^2, {x, 0, 1}, PlotRange -> {0, 1}, PlotStyle -
> {{Thickness[0.025], Black}}]];

{cc, c} = Timing[Plot[x^2, {x, 0, 1}, PlotRange -> {0, 1}, PlotStyle -
> {Thickness[0.01], Red, Dashed}]];

{bb, b} = Timing[Plot[x^2, {x, 0, 1}, PlotRange -> {0, 1}, Mesh -> 15,
MeshStyle -> Directive[PointSize[0.035], Green], PlotStyle ->
{{Thickness[0.01], Red, Dashed}}]];
Show[a, c, b]
=============================
with the first curve being "CPU time =" aa
I've tried using:
Needs["PlotLegends`"]
along with Show[a,c,b,PlotLegend->{{"CPU time=" aa},{"CPU time=" cc},
{"CPU time=" bb}}
And I've also tried putting the legend command inside the Plot command
in the line {aa,a}=Timing[Plot.....
But sadly, neither of these methods worked ='(
Would any brave souls wish to lead me to the light ?
Thank you!
Nike

URL: ,

Subject (listing for 'Legend for combined plot')
Author Date Posted
Legend for combined plot Nike Dattani 12/18/11 10:05pm
Re: Legend for combined plot Quinn McKinsey 12/30/11 07:07am
Next Comment >Help | Reply To Topic