MathGroup Archive 2009

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

Search the Archive

Re: Re: How to combine Dynamic graphics

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105569] Re: [mg105541] Re: How to combine Dynamic graphics
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Wed, 9 Dec 2009 05:44:10 -0500 (EST)
  • References: <200912081143.GAA29140@smc.vnet.net>
  • Reply-to: drmajorbob at yahoo.com

Your Show sees only graphics in your example:

Show[{pl, Graphics[...]}, ImageSize -> 500]

pl has head Graphics, and so does the second list item.

Yes, the "..." includes Dynamic, but Show isn't seeing that.

Bobby

On Tue, 08 Dec 2009 05:43:08 -0600, Alexei Boulbitch  
<Alexei.Boulbitch at iee.lu> wrote:

> From: "John Fultz" <jfultz at wolfram.com>
>
>
> "Show doesn't know how to deal with something that has the head  
> Dynamic."....
>
> Let me give a counter-example. In what follows I show a piece of code  
> from one of my presentations, and I am much too lazy
> to shorten it for the purposes of demonstrating within this discussion.  
> Please excuse me. Anyway, it contains several definitions
> of equations to be drawn that are irrelevant for the present discussion.  
> However, in the
> code part that is entitled "MainPart" you will find the Show statement  
> wrapped around Dynamic (and also the
> DynamicModule wrapped around Show). Everything functions as desired.  
> Please have a look:
>
>
> g1[x_] := If[x <= 0, (3*x^2)/16, 0];
> g2[x_] := If[x <= 0, x^2/4, 0];
> g3[x_] := 0;
> eta2[t_, b_] := If[t - 1 > 0, 0, 2.*Sqrt[-(t - 1)/(b + 0.01)]];
> eta1[t_, b_] :=
>   If[t - 1 >= (3*b^2)/16, 0,
>    0.7*(Sqrt[3*Abs[b]]/2 + Sqrt[-(t - 1) + b^2/4])];
> eta[t_, b_] := If[b >= 0, eta2[t, b], eta1[t, b]];
>
> point[a_, b_] := Disk[{b, a}, 0.1];
> pl = Plot[{Tooltip[g1[x], "f(\[Eta]\[NotEqual]0)=f(\[Eta]=0)"],
>     Tooltip[g2[x],
>      "(\!\(\*SuperscriptBox[\"d\", \"2\"]\)f/\!\(\*SuperscriptBox[\"d\
> \[Eta]\", \"2\"]\)\!\(\*SubscriptBox[\")\",
> RowBox[{\"\[Eta]\", \"\[NotEqual]\", \"0\"}]]\)=0"],
>     Tooltip[g3[x],
>      "(\!\(\*SuperscriptBox[\"d\", \"2\"]\)f/\!\(\*SuperscriptBox[\"d\
> \[Eta]\", \"2\"]\)\!\(\*SubscriptBox[\")\",
> RowBox[{\"\[Eta]\", \"=\", \"0\"}]]\)=0"]}, {x, -4, 2},
>    PlotRange -> {{-4, 2}, {-2, 3}}, PlotStyle -> Thick, Axes -> True,
>    Ticks -> None, AxesLabel -> {\[Beta], \[Alpha]},
>    LabelStyle -> Directive[Large], ImageSize -> 350,
>    Epilog -> {Inset[
>       Text[Style["\[Eta]=0", FontSize -> 20]], {1.5, 2.5}],
>      Inset[Text[
>        Style["\[Eta]\[NotEqual]0", FontSize -> 20]], {-1, -1.5}] },
>    Filling -> {2 -> {3}},
>    PlotLabel -> Style["Phase Diagram", 20, Red, Bold]];
>
>
>
> MainPart =
>  DynamicModule[{pt = {1.7, 2}},
>   GraphicsColumn[{Show[{pl, Graphics[Locator[Dynamic[pt]]]},
>      ImageSize -> 500],
>     GraphicsRow[{Dynamic[
>        Plot[pt[[2]] x^2/2 + pt[[1]] x^4/4 + x^6/6, {x, -3, 3},
>         PlotRange -> {{-4, 4}, {-2, 3}}, Axes -> True, Ticks -> None,
>         AxesLabel -> {Style[\[Eta], Large, Plain,
>            FontFamily -> "Symbol"],
>           Style["f", Large, Italic, FontFamily -> "Times New Roman"]},
>          PlotStyle -> {Thick, Blue}, LabelStyle -> Directive[Large],
>         PlotLabel -> Style["Landau Potential", 20, Red, Bold] (*,
>         ImageSize->400*)]],
>       Dynamic[Plot[
>         Tooltip[eta[t, pt[[1]]], "\!\(\*SqrtBox[FractionBox[
> RowBox[{
> RowBox[{\"-\", \"\[Beta]\"}], \"+\", SqrtBox[
> RowBox[{SuperscriptBox[\"\[Beta]\", \"2\"], \"-\",
> RowBox[{\"4\", \"\[Alpha]\[Gamma]\"}]}]]}],
> RowBox[{\"2\", \"\[Gamma]\"}]]]\)"], {t, pt[[2]] + 1, 3.2},
>         PlotRange -> {{0, 3}, {0, 2.5}},(*ImageSize->400,*)
>         PlotStyle -> {Thick, Blue}, Ticks -> None, Axes -> True,
>         AxesLabel -> {T, \[Eta]},
>         PlotLabel -> Style["Order Parameter", 20, Red, Bold],
>         LabelStyle -> Directive[Large]]]}, ImageSize -> 700,
>      Spacings -> 70]}, Spacings -> -350]]
>
>
> Regards, Alexei
>
>


-- 
DrMajorBob at yahoo.com


  • Prev by Date: Re: Re: How to combine Dynamic graphics
  • Next by Date: Re: Bug ??????
  • Previous by thread: Re: How to combine Dynamic graphics
  • Next by thread: Re: Re: How to combine Dynamic graphics