MathGroup Archive 2008

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

Search the Archive

Re: several plots in manipulate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg90870] Re: several plots in manipulate
  • From: "Cristina Ballantine" <cballant at holycross.edu>
  • Date: Sun, 27 Jul 2008 02:31:18 -0400 (EDT)

The enclosed message solved the problem I posted on the discussion group.

Thank you!


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 ParameterPlot
> 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}
  ]
 ]



  • Prev by Date: Re: question about sorting lists
  • Next by Date: Re: Cube root of -1 and 1
  • Previous by thread: Re: several plots in manipulate
  • Next by thread: Can't Simplify logical expression