Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

AttributeError: must give both plot endpoints

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