MathGroup Archive 2009

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

Search the Archive

Re: Keep Slider Consistent With a Slow Graph

  • To: mathgroup at
  • Subject: [mg100197] Re: Keep Slider Consistent With a Slow Graph
  • From: David Bailey <dave at>
  • Date: Thu, 28 May 2009 04:26:17 -0400 (EDT)
  • References: <gvdqtl$6q1$>

bobbaillie at wrote:
> 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_] :=
> Module[
>   { x, t },
>   Plot[ NIntegrate[1/((t^2 - 1)*t*Log[t]),
>        {t, x, Infinity}], {x, 2, xMax} ]
> ];
> Manipulate[
>   Graphics[ plotSlowGraph[xMax] ],
>   { {xMax, 10, "x Max"}, 10, 400, 10, Appearance -> "Labeled" },
>   ContinuousAction -> False, SaveDefinitions->True
> ]
I would have thought that if you have a really slow process, a slider 
just isn't a good way to manipulate it. Even with 
ContinuousAction->False, you have the problem that merely releasing the 
mouse will initiate a calculation at a value the user may not want.

Maybe you need a design in which the slider manipulates a number in an 
InputField (which could obviously also be set directly) together with a 
button that initiates a calculation.

David Bailey

  • Prev by Date: Re: Re: overlay of multiple plots Show command does not work
  • Next by Date: Re: using predefined expressions in functions [newbie question]
  • Previous by thread: Re: Keep Slider Consistent With a Slow Graph
  • Next by thread: evaluating functions within Findminimum