MathGroup Archive 2009

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

Search the Archive

Keep Slider Consistent With a Slow Graph

  • To: mathgroup at
  • Subject: [mg100101] Keep Slider Consistent With a Slow Graph
  • From: bobbaillie at
  • Date: Mon, 25 May 2009 06:13:18 -0400 (EDT)

The graph displayed by the Manipulate below takes a while to display.
While the calculation is taking place, if you click on some other
value on the slider, the slider moves and displays its new value.
However, the graph will plot using the original value.

The result is that the graph and the slider are now out of sync.  This
is bad user interface design.

In the real example I am working with, there is no way to make the
calculations go fast enough to keep up with clicks on the slider.  For
the same reason, I cannot allow the user to slide the slider, so
ContinuousAction must be False.

Nevertheless, is there some way to make sure the slider and the graph
stay consistent with each other?

Robert Baillie

plotSlowGraph[xMax_] :=
  { x, t },
  Plot[ NIntegrate[1/((t^2 - 1)*t*Log[t]),
       {t, x, Infinity}], {x, 2, xMax} ]

  Graphics[ plotSlowGraph[xMax] ],
  { {xMax, 10, "x Max"}, 10, 400, 10, Appearance -> "Labeled" },
  ContinuousAction -> False, SaveDefinitions->True

  • Prev by Date: Re: Are you wolfing tonight?
  • Next by Date: evaluating functions within Findminimum
  • Previous by thread: Re: TRANSFER FILE NAMES
  • Next by thread: Re: Keep Slider Consistent With a Slow Graph