MathGroup Archive 2008

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

Search the Archive

Mouse operation, slider, dynamics, plot combination

  • To: mathgroup at smc.vnet.net
  • Subject: [mg84858] Mouse operation, slider, dynamics, plot combination
  • From: "Nasser Abbasi" <nma at 12000.org>
  • Date: Wed, 16 Jan 2008 23:06:18 -0500 (EST)

Hello;

I am not sure what I am doing wrong here. I am doing the following:

Dynamic[Plot[Sin[x], {x, -r, r},
    PlotRange -> {{-r, r}, {-s, s}},
   Frame -> True,
   ImageSize -> 300,
   FrameLabel ->  {Slider[Dynamic[r], {1, 10}], VerticalSlider[Dynamic[s], 
{1, 10}]},
   RotateLabel -> False]
]

The above works to some extent, but when I press the mouse on the slider to 
move it, it does not really move well. When I click on a different position 
on the slider, it jumps there and the plot is updated.

One way to fix this problem is to add ContinuousAction -> False to each 
Dynamics, so now the slides move smooth, but the plot is NOT updated until 
one releases the mouse:

Dynamic[Plot[Sin[x], {x, -r, r},
      PlotRange -> {{-r, r}, {-s, s}},
      Frame -> True, ImageSize -> 300,
      FrameLabel -> {Slider[Dynamic[r], {1, 10}, ContinuousAction -> False],
                               VerticalSlider[Dynamic[s], {1, 10}, 
ContinuousAction -> False]},
      RotateLabel -> False]
]

I'd like the slider to move smoothly and the put updated at the same time. I 
am sure this can be done ofcourse.

I tried adding Refersh, but this did not help. I tried playing with the 
options to Dynamic[ Plot[..], {options} ] but again, did not get it working.

thanks,
Nasser







  • Prev by Date: Re: Version 6 graphics can be painfully slow
  • Next by Date: Re: Don't understand behavior of ClearAttributes[Plus,
  • Previous by thread: Re: Simplifying integer expressions with Mod and BitAnd
  • Next by thread: Re: Mouse operation, slider, dynamics, plot combination