Re: Trying to close some loose plotting

• To: mathgroup at smc.vnet.net
• Subject: [mg124688] Re: Trying to close some loose plotting
• From: Bob Hanlon <hanlonr357 at gmail.com>
• Date: Tue, 31 Jan 2012 05:39:38 -0500 (EST)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• References: <201201301008.FAA17519@smc.vnet.net>

```I use v8 and do not see any gaps so I cannot comment on how to fix
your problem other than to suggest that increasing PlotPoints may
help.

On a separate note,

Np = Length[rctab];
\[Lambda]1tab = Table[\[Lambda]1 /. rc -> rctab[[i]], {i, 1, Np}];
\[Lambda]2tab = Table[\[Lambda]2 /. rc -> rctab[[i]], {i, 1, Np}];
\[Lambda]3tab = Table[\[Lambda]3 /. rc -> rctab[[i]], {i, 1, Np}];
\[Lambda]123 = Flatten[{\[Lambda]1tab, \[Lambda]2tab, \[Lambda]3tab}];

can be shortened to

\[Lambda]123 =
Flatten[{\[Lambda]1, \[Lambda]2, \[Lambda]3} /. rc -> rctab];

Bob Hanlon

On Mon, Jan 30, 2012 at 5:08 AM,  <carlos at colorado.edu> wrote:
> Hi -  I am trying to plot the real roots of a cubic equation as
> functions of one parameter called rc, using the code below, on Mathematica 5.2.
> The plotted curves, however,  show some dead spots that should not be
> there.
> How can I get them to fill up?  I tried getting rid of the imaginary part when its absolute value is less that a given tolerance, but that trick does not
> work.
>
> Thanks for any suggestions.
>
> ClearAll[\[Mu],\[Lambda],\[Beta],a,b,rc];
> \[Lambda]1=(2*\[Mu]-(2*2^(1/3)*(-3+2*\[Mu]^2))/(27*rc-18*\[Mu]+20*\
> [Mu]^3+
>    Sqrt[4*(-3+2*\[Mu]^2)^3+(27*rc-18*\[Mu]+20*\
> [Mu]^3)^2])^(1/3)+2^(2/3)*
>   (27*rc-18*\[Mu]+20*\[Mu]^3+Sqrt[4*(-3+2*\[Mu]^2)^3+(27*rc-18*\[Mu]
> +20*\[Mu]^3)^2])^(1/3))/6;
> \[Lambda]2=(4*\[Mu]+(2*2^(1/3)*(1+I*Sqrt[3])*(-3+2*\[Mu]^2))/(27*rc-18*
> \[Mu]+20*\[Mu]^3+
>    Sqrt[4*(-3+2*\[Mu]^2)^3+(27*rc-18*\[Mu]+20*\[Mu]^3)^2])^(1/3)+
>    I*2^(2/3)*(I+Sqrt[3])*(27*rc-18*\[Mu]+20*\[Mu]^3+Sqrt[4*(-3+2*\
> [Mu]^2)^3+
>    (27*rc-18*\[Mu]+20*\[Mu]^3)^2])^(1/3))/12;
> \[Lambda]3=(4*\[Mu]+(2*2^(1/3)*(1-I*Sqrt[3])*(-3+2*\[Mu]^2))/(27*rc-18*
> \[Mu]+20*\[Mu]^3+
>    Sqrt[4*(-3+2*\[Mu]^2)^3+(27*rc-18*\[Mu]+20*\[Mu]^3)^2])^(1/3)-
>    2^(2/3)*(1+I*Sqrt[3])*(27*rc-18*\[Mu]+20*\[Mu]^3+Sqrt[4*(-3+2*\
> [Mu]^2)^3+
>    (27*rc-18*\[Mu]+20*\[Mu]^3)^2])^(1/3))/12;
> thick=AbsoluteThickness[1.25];
> p1style={{thick,RGBColor[0,0,0]},
>   {thick,RGBColor[1,0,0]},  {thick,RGBColor[0,1,0]},
>   {thick,RGBColor[0,0,1]},  {thick,RGBColor[1,1/2,0]},
>   {thick,RGBColor[1/2,0,1]},{thick,RGBColor[1,0,1]},
>   {thick,RGBColor[1,0,1/2]},{thick,RGBColor[1,0,0]},
>   {thick,RGBColor[0,1,0]},  {thick,RGBColor[0,0,1]},
>   {thick,RGBColor[1,1/2,0]},{thick,RGBColor[1/2,0,1]},
>   {thick,RGBColor[1,0,1]},  {thick,RGBColor[1,0,1/2]}};
> rctab={0, 0.04, 0.08, 0.15, 0.3, 0.5, 1, 2,
>             -0.04,-0.08,-0.15,-0.3,-0.5,-1,-2};
> Np=Length[rctab];
> \[Lambda]1tab=Table[\[Lambda]1/.rc->rctab[[i]],{i,1,Np}];
> \[Lambda]2tab=Table[\[Lambda]2/.rc->rctab[[i]],{i,1,Np}];
> \[Lambda]3tab=Table[\[Lambda]3/.rc->rctab[[i]],{i,1,Np}];
> \[Lambda]123=Flatten[{\[Lambda]1tab,\[Lambda]2tab,\[Lambda]3tab}];
> Off[Plot::"plnr"];
> Plot[Evaluate[\[Lambda]123],{\[Mu],-1,1},PlotStyle->p1style,
>    PlotRange->{-1.5,1.5},AspectRatio->1.5,Frame->True,
>    ImageSize->300,DisplayFunction->\$DisplayFunction]

```

• Prev by Date: Re: navigate notebook, further question
• Next by Date: Re: Compile function and AppendTo for lists (vrs. 8.0.4)
• Previous by thread: Trying to close some loose plotting
• Next by thread: Re: navigate notebook, further question