Ask Your Question
0

How to have open parenthesis in slider?

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

jaqatra gravatar image

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

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 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
1

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

tmonteil gravatar image

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

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 +0200

Seen: 122 times

Last updated: Oct 02 '21