Ask Your Question
0

How to have open parenthesis in slider?

asked 2021-10-01 16:31:21 +0100

jaqatra gravatar image

updated 2021-10-02 00:21:08 +0100

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)
edit retag flag offensive close merge delete

Comments

could you please provide your current code ?

tmonteil gravatar imagetmonteil ( 2021-10-01 23:11:53 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-10-02 10:03:16 +0100

tmonteil gravatar image

updated 2021-10-02 10:03:32 +0100

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)
edit flag offensive delete link more

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: 2021-10-01 16:31:21 +0100

Seen: 171 times

Last updated: Oct 02 '21