First time here? Check out the FAQ!

Ask Your Question
0

How to have open parenthesis in slider?

asked 3 years ago

jaqatra gravatar image

updated 3 years ago

In interact slider, I can specify max and min. But the max and min are [min,max]. I want to have [min,max) in the interact slider. Is there a separate function to do so?

   @interact
    def main(x=slider(0,1,0.0000001,0.5))
          plot(tan(x), x, -pi, pi, detect_poles=True)
Preview: (hide)

Comments

could you please provide your current code ?

tmonteil gravatar imagetmonteil ( 3 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 3 years ago

tmonteil gravatar image

updated 3 years ago

If you look at the description of the slider function:

sage: slider?

You can see that there is no option to exclude the endpoints. As workaround, you can start one step later and stop one step before the endpoints:

step = 0.0000001
@interact
def main(x=slider(0+step, 1-step, step, 0.5)):
    plot(tan(x), x, -pi, pi, detect_poles=True)
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 3 years ago

Seen: 184 times

Last updated: Oct 02 '21