Plotting arrays against each other

19 views
Skip to first unread message

Brenton

unread,
Apr 26, 2015, 10:00:26 PM4/26/15
to sage-s...@googlegroups.com
Hi, I started numerical computing in MATLAB and it is the math software I am the most familiar with hence why I was wondering if it is possible to plot two column vectors (that are in the form of two (N+1)x1 arrays) against each other. I have tried plot(x,y) but it gave the error:

Traceback (most recent call last):
 
File "<stdin>", line 1, in <module>
 
File "_sage_input_37.py", line 10, in <module>
   
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cGxvdCh4LHkp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
   
  File "/tmp/tmpzcq1Qn/___code___.py", line 2, in <module>
    exec compile(u'
plot(x,y)
 
File "", line 1, in <module>
   
 
File "/home/sage/sage-6.6/local/lib/python2.7/site-packages/sage/misc/decorators.py", line 705, in wrapper
   
return func(*args, **kwds)
 
File "/home/sage/sage-6.6/local/lib/python2.7/site-packages/sage/misc/decorators.py", line 550, in wrapper
   
return func(*args, **options)
 
File "/home/sage/sage-6.6/local/lib/python2.7/site-packages/sage/plot/plot.py", line 1295, in plot
    G
= _plot(funcs, *args, **kwds)
 
File "/home/sage/sage-6.6/local/lib/python2.7/site-packages/sage/plot/plot.py", line 1407, in _plot
    xmin
, xmax, delta = ranges[0]
ValueError: too many values to unpack

Brenton

unread,
Apr 26, 2015, 10:03:09 PM4/26/15
to sage-s...@googlegroups.com
I am running Sage 6.6 via VirtualBox, if relevant. 

slelievre

unread,
Apr 26, 2015, 10:12:02 PM4/26/15
to sage-s...@googlegroups.com
Maybe point2d and zip can help?
Could you provide an example
(maybe the example that triggers
the error you quoted)?
Samuel

2015-04-27 04:00:26 UTC+2, Brenton:

Hi, I started numerical computing in MATLAB and it is the math software I am the most familiar with hence why I was wondering if it is possible to plot two column vectors (that are in the form of two (N+1)x1 arrays) against each other. I have tried plot(x,y) but it gave the error:
<snip>
Reply all
Reply to author
Forward
0 new messages