Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: Flashing Graphs With Manipulate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg88710] Re: [mg88672] Flashing Graphs With Manipulate
  • From: "W_Craig Carter" <ccarter at mit.edu>
  • Date: Tue, 13 May 2008 07:11:06 -0400 (EDT)
  • References: <200805120846.EAA21345@smc.vnet.net>

This is curious, if you don't use the plotlabel:

Manipulate[
 With[{func = b x + c}, Module[{rts}, rts = NSolve[func == 0, x];
   ListPlot[{Re[x], Im[x]} /. rts, PlotStyle -> PointSize[0.03],
    PlotRange -> {{-10, 10}, {-10, 10}}, ImageSize -> {300, 300},
    AspectRatio -> 1(*,PlotLabel->func*)]]], {{b, -1,
   "coefficient of x"}, -9, 9, .1,
  Appearance -> "Labeled"}, {{c, 3, "constant term"}, -10, 10, .1,
  Appearance -> "Labeled"}]

The flashing goes away.

Further if you wrap the label in ToString

Manipulate[
 With[{func = b x + c}, Module[{rts}, rts = NSolve[func == 0, x];
   ListPlot[{Re[x], Im[x]} /. rts, PlotStyle -> PointSize[0.03],
    PlotRange -> {{-10, 10}, {-10, 10}}, ImageSize -> {300, 300},
    AspectRatio -> 1, PlotLabel -> ToString[func]]]], {{b, -1,
   "coefficient of x"}, -9, 9, .1,
  Appearance -> "Labeled"}, {{c, 3, "constant term"}, -10, 10, .1,
  Appearance -> "Labeled"}]

The flashing goes away.

That's a solution, but I don't understand the cause...
WCC


On Mon, May 12, 2008 at 4:46 AM,  <bobbaillie at frii.com> wrote:
> If the coefficient of x is < 0 and the constant term is > 0,
>  this graph flashes as you drag the sliders.
>
>  Why?  NSolve can't be taking that much longer in this case.
>
>  What can be done to prevent the flashing?
>
>  Manipulate[


  • Prev by Date: Re: Display commands in a package
  • Next by Date: Linking EventHandler to a Control Object
  • Previous by thread: Re: Flashing Graphs With Manipulate
  • Next by thread: Re: Flashing Graphs With Manipulate