Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Attach legend to a family of functions?
Replies: 3   Last Post: Dec 30, 2012 8:49 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Dário Abdulrehman

Posts: 8
Registered: 5/26/10
Re: Attach legend to a family of functions?
Posted: Dec 30, 2012 8:49 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Friday, December 28, 2012 10:32:49 AM UTC, Helen Read wrote:
> Assuming Mathematica 9, use PlotLegends.
>
>
>
> Plot[Evaluate[{(1 + x - t - 4 x (1 + x) t +
>
> Sqrt[(x + 2 x^2)^2 t])/((1 + 2 x)^2 t - 1)} /.
>
> t -> Range[0, 1, 0.1]], {x, 0, 20}, PlotLegends -> Range[0, 1, .1]]
>
>
>
> Or slightly fancier:
>
>
>
> Plot[Evaluate[{(1 + x - t - 4 x (1 + x) t +
>
> Sqrt[(x + 2 x^2)^2 t])/((1 + 2 x)^2 t - 1)} /.
>
> t -> Range[0, 1, 0.1]], {x, 0, 20},
>
> PlotLegends ->
>
> LineLegend[Range[0, 1, .1], LegendLabel -> "Value of t",
>
> LegendFunction -> "Frame", LegendMargins -> 5,
>
> Background -> LightGray]]
>
>
>
> Helen Read
>
> University of Vermont
>
>
>
> On 12/27/2012 5:02 AM, dabd wrote:
>

> > How can I attach a legend to this plot?
>
> >
>
> > Plot[Evaluate[{(1+x-t-4x(1+x)t+Sqrt[(x+2x^2)^2 t])/((1+2x)^2 t-1)}/.t->Range[0,1,0.1]],{x,0,20}]
>
> >
>
> > I would like a legend for each t in the range.
>
> >
>
> > Thanks.
>
> >

Thanks this looks nice.




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.