Ask Your Question
0

hi , what wrong with this code

asked 2017-09-08 02:25:14 -0600

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 08:52:24 -0600

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 02:25:14 -0600

Seen: 89 times

Last updated: Sep 08