Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
1  
Check the second argument of Dynamic –  Rojo Dec 14 '13 at 2:07
1  
Great - will do that now :) –  martin Dec 14 '13 at 2:09
    
More specifically: The Second Argument of Dynamic –  Michael E2 Dec 14 '13 at 2:10
2  
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. –  Pickett Dec 14 '13 at 2:13
add comment

1 Answer

up vote 6 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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