MathGroup Archive 2008

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

Search the Archive

Re: several plots in manipulate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg90827] Re: several plots in manipulate
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Fri, 25 Jul 2008 06:17:32 -0400 (EDT)
  • References: <g670kg$s2i$1@smc.vnet.net>

On Jul 23, 12:20 pm, "Cristina Ballantine" <cball... at holycross.edu>
wrote:

> I would like to manipulate a plot created from three different parametric
> plots. I display the plot with Show[plot1,plot2,plot3] (see code below).
> If I try this in Manipulate, the plots are displayed next to each other. =
I
> need them in a single plot. I cannot combine them in a single ParameterPl=
ot
>  because the options are different.

On my system, the following works as expected: the three plots are
drawn on the same graph, though it takes few seconds for the complete
rendering to be completed. (Note that I have written the expressions
for the plots as function of three parameters and added the option
MaxRecursion->0 to speed up computations.)

    With[{r1 = 1/4, u = Pi/3},
     Manipulate[
      Show[plot1[r1, r2, u], plot2[r1, r2, u],
       plot3[r1, r2, u]], {{r2, 2/3}, r1, 1}]]

HTH,
- Jean-Marc

$Version

"6.0 for Mac OS X x86 (64-bit) (May 21, 2008)"

plot1[r1_, r2_, u_] :=
 ParametricPlot[{{Re[
     1*Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[1*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[
     1*Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[1*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[
     I*Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +

           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[I*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[
     I*Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[I*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[(-1)*
      Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[(-1)*
      Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[(-1)*
      Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[(-1)*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[(-I)*
      Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[(-I)*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[(-I)*
      Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[(-I)*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}}, {t, 10^(-10), 2*Pi - 10^(-10)}, {r, 0,
   r1^4*r2^4 - 10^(-6)}, PlotRange -> All,
  ColorFunction -> Function[{x, y, t, r}, Hue[.5, t, r]],
  PlotPoints -> 25, MaxRecursion -> 0, Mesh -> False]

plot2[r1_, r2_, u_] :=
 ParametricPlot[{{Re[
     1*Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[1*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[
     1*Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[1*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[
     I*Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[I*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[
     I*Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -

             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[I*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[(-1)*
      Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[(-1)*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[(-1)*
      Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[(-1)*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -

           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[(-I)*
      Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[(-I)*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[(-I)*
      Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[(-I)*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}}, {t, 10^(-10), 2*Pi - 10^(-10)}, {r,
   r1^4*r2^4 - 10^(-6), r1^4*r2^4 + 10^(-2)}, PlotRange -> All,
  ColorFunction -> Function[{x, y, t, r}, Hue[1, t, r]],
  PlotPoints -> 45, MaxRecursion -> 0, Mesh -> False]

plot3[r1_, r2_, u_] :=
 ParametricPlot[{{Re[
     1*Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[1*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[
     1*Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[1*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -

             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[
     I*Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[I*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[
     I*Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[I*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[(-1)*
      Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +

           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[(-1)*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[(-1)*
      Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[(-1)*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[(-I)*
      Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[(-I)*
      Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) +
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}, {Re[(-I)*
      Exp[I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/4)],
    Im[(-I)*Exp[
       I*u]*(((r1^4 + r2^4)*(1 - r*Exp[I*t]) -
           Sqrt[(r1^4 + r2^4)^2*(1 - r*Exp[I*t])^2 -
             4*(1 - r1^4*r2^4*r*Exp[I*t])*(r1^4*r2^4 -
                r*Exp[I*t])])/(2*(1 - r1^4*r2^4*r*Exp[I*t])))^(1/
         4)]}}, {t, 10^(-10), 2*Pi - 10^(-10)}, {r,
   r1^4*r2^4 + 10^(-2), 1}, PlotRange -> All,
  ColorFunction -> Function[{x, y, t, r}, Hue[.1, t, r]],
  PlotPoints -> 25, MaxRecursion -> 0, Mesh -> False]

With[{r1 = 1/4, u = Pi/3},
 Manipulate[
  Show[plot1[r1, r2, u], plot2[r1, r2, u],
   plot3[r1, r2, u]], {{r2, 2/3}, r1, 1}
  ]
 ]

-------------- End of Code


  • Prev by Date: Re: Function Programming Problems
  • Next by Date: Re: Reading Directive Values
  • Previous by thread: several plots in manipulate
  • Next by thread: Re: several plots in manipulate