Ask Your Question
0

hi , what wrong with this code

asked 2017-09-08 09:25:14 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

when i enter

@interact
def _(a=(1,4,1), b=(0,10,1)):
    show(plot(sin(a*x+b), (x,0,2*pi/a),ticks=pi/2*a,tick_formatter='latex',gridlines=True))

sage notebook 7.3 fedora 25 gives the error

ValueError: Expand the range of the independent variable to allow two
multiples of your tick locator (option `ticks`).
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-09-08 15:52:24 +0100

calc314 gravatar image

Sage wants to put two tickmarks on the graph and is asking that you extend the x-range so that it can do so. Try changing the code to:

show(plot(sin(a*x+b), (x,0,a*pi),ticks=pi/2*a,tick_formatter='latex',gridlines=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

Stats

Asked: 2017-09-08 09:25:14 +0100

Seen: 233 times

Last updated: Sep 08 '17