MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Attach legend to a family of functions?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg129276] Re: Attach legend to a family of functions?
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Fri, 28 Dec 2012 05:36:43 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <20121227100507.F069D687A@smc.vnet.net>

It is easier to see if you use the Exclusions option to remove the
discontinuities.

Simplify[
 Solve[{
    ((1 + 2 x)^2 t - 1) == 0, 0 < t < 1, x > 0},
   x][[1]], 0 < t < 1]

{x -> (1/2)*(-1 + 1/Sqrt[t])}


Plot[
 Evaluate[
  Tooltip[
   Simplify[
    Table[
     Tooltip[
      y = (1 + x - t - 4 x (1 + x) t + Sqrt[(x + 2 x^2)^2 t])/
        ((1 + 2 x)^2 t - 1),
      {t // N, y}],
     {t, 0, 1, 1/10}],
    x >= 0]]],
 {x, 0, 20},
 Frame -> True,
 Axes -> False,
 PlotLegends -> Range[0, 1, .1],
 ImageSize -> 500,
 AspectRatio -> .75,
 PlotRange -> {-2.25, 1.25},
 Exclusions -> Table[(1 - Sqrt[t])/(2*Sqrt[t]),
   {t, 1/10, 9/10, 1/10}]]


Bob Hanlon


On Thu, Dec 27, 2012 at 8:28 AM, Bob Hanlon <hanlonr357 at gmail.com> wrote:
> Plot[
>  Evaluate[
>   Tooltip[
>    Simplify[
>     Table[
>      Tooltip[
>       y = (1 + x - t - 4 x (1 + x) t + Sqrt[(x + 2 x^2)^2 t])/
>         ((1 + 2 x)^2 t - 1),
>       {t // N, y}],
>      {t, 0, 1, 1/10}],
>     x >= 0]]],
>  {x, 0, 20},
>  Frame -> True,
>  Axes -> False,
>  PlotLegends -> Range[0, 1, .1],
>  ImageSize -> 500,
>  AspectRatio -> .75]
>
>
> Bob Hanlon
>
>
> On Thu, Dec 27, 2012 at 5:05 AM, dabd <dario.rehman at gmail.com> 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.
>>



  • Prev by Date: Re: Usage Messages in Mathematica
  • Next by Date: Problem with Expand and Modulus in Mathematica 9?
  • Previous by thread: Re: Attach legend to a family of functions?
  • Next by thread: Re: Attach legend to a family of functions?