Ask Your Question
1

AttributeError: must give both plot endpoints

asked 2014-12-05 09:14:56 -0600

gelatine1 gravatar image

I use this piece of code in my project:

print h
print h(3.2)
print parent(h)
plot(h(x) , (-4,4), thickness=2, color='green' )

and this is my output:

2.14250281996159*x + 1.74284059736793
8.59884962124501
Univariate Polynomial Ring in x over Real Field with 53 bits of precision
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_231.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cHJpbnQgaApwcmludCBoKDMuMikKcHJpbnQgcGFyZW50KGgpCnBsb3QoaCh4KSAsICgtNCw0KSwgdGhpY2tuZXNzPTIsIGNvbG9yPSdncmVlbicgKQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>

  File "/var/sage/tmp2yTHkg/___code___.py", line 6, in <module>
    exec compile(u"plot(h(x) , (-_sage_const_4 ,_sage_const_4 ), thickness=_sage_const_2 , color='green' )" + '\n', '', 'single')
  File "", line 1, in <module>

  File "/opt/sage/sage-6.3/local/lib/python2.7/site-packages/sage/misc/decorators.py", line 705, in wrapper
    return func(*args, **kwds)
  File "/opt/sage/sage-6.3/local/lib/python2.7/site-packages/sage/misc/decorators.py", line 550, in wrapper
    return func(*args, **options)
  File "/opt/sage/sage-6.3/local/lib/python2.7/site-packages/sage/plot/plot.py", line 1163, in plot
    G = funcs.plot(*args, **original_opts)
  File "polynomial_element.pyx", line 286, in sage.rings.polynomial.polynomial_element.Polynomial.plot (build/cythonized/sage/rings/polynomial/polynomial_element.c:5907)
AttributeError: must give both plot endpoints

Why does this happen ? I have specified my endpoints right? so why is it saying I didn't ? I tried a lot to solve this but i can't get it solved.. anyone who can tell me whats wrong ?

Thanks in advance

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-12-05 09:47:09 -0600

kcrisman gravatar image

Try

 sage: plot(h(x),-4,4)

Unfortunately, polynomial plotting is from another era.


To the cognoscenti: why does this example from

sage: sage.rings.polynomial.polynomial_element.Polynomial.plot?

"work"? Shouldn't it raise an error with the endpoints?

sage: x = polygen(GF(389))
sage: plot(x^2+1,(-1,1))

Also, it is interesting that this is the doc that comes up, since there are branches for both characteristic zero and finite, and we don't test the char zero one!

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: 2014-12-05 09:14:56 -0600

Seen: 142 times

Last updated: Dec 05 '14