0
$\begingroup$

Sorry - bit of a yes/no question: Is it possible to make the slider from a manipulation jump in irregular steps? Or would the best way to overcome this be to just create a series of buttons that jump the manipulation to the desired position?

$\endgroup$
  • 1
    $\begingroup$ Check the second argument of Dynamic $\endgroup$ – Rojo Dec 14 '13 at 2:07
  • 1
    $\begingroup$ Great - will do that now :) $\endgroup$ – martin Dec 14 '13 at 2:09
  • $\begingroup$ More specifically: The Second Argument of Dynamic $\endgroup$ – Michael E2 Dec 14 '13 at 2:10
  • 2
    $\begingroup$ If it doesn't matter where on the slider the knob lies, this syntax will do it: Slider[Dynamic[x],{{val1,val2,val3,...}}]. If it matters, look at the documentation page for Slider, last example under Scope. $\endgroup$ – C. E. Dec 14 '13 at 2:13
6
$\begingroup$

Just writing down what I and Rojo talked about in the comments, we get:

datapoints = {{1, 1}, {5, 4}, {20, 15}};
Manipulate[
 n,
 {n, datapoints, ControlType -> "Slider"},
 Initialization :> (n = 1)
 ]

where the slider jumps from 1 to 5 to 20. The gap between one and five is four, the gap between five and twenty is fifteen.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.