help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC] running r,python from octave - plotting in octave via matplotlib


From: Soeren Sonnenburg
Subject: [RFC] running r,python from octave - plotting in octave via matplotlib
Date: Sun, 08 Mar 2009 21:38:03 +0100

Dear all,

a Shogun 0.7.1 is out and available at http://www.shogun-toolbox.org

which contains one new feature that might be of interest to octave
users. The eierlegendewollmilchsau interface. In
case you don't know what this term stands for use google images :-)

It is one file that will interface shogun to octave,r,python,matlab. It
provides commands to run code in foreign languages:

This would pass A to python from e.g. octave:

elwms('run_python', 'A', A, 'pythoncode', 'print A')

Or you could use pythons matplotlib to plot figures within octave and
freak out passign around strings cells, or whatever (u)int8/16/32,
single/double matrix type.

Example:

% this uses matplotlib to plot a figure from within octave

A=[[1,2,3];[4,5,6]];
B=[[1,1,1];[0,0,0]];
pythoncode=sprintf("\
\
import numpy\n\
x=numpy.array([[1.0,2,3],[4,5,6]])\n\
results=(A, B, [ 'bla1', 'bla2' ], x)\n\
\
from pylab import *\n\
plot(B)\n\
show()\n\
\
")

[A2,B2,bla,x]=elwms('run_python', 'A',A, 'B',B, 'pythoncode',
pythoncode)
sprintf('%s\n', char(bla{1}))
sprintf('%s\n', char(bla{2}))

See http://www.shogun-toolbox.org/doc/elwmsinterface.html .
Don't even try to run octave from python from octave etc nested.
Neither octave, R nor python-numpy nor libshogun supports this :-)

Soeren


reply via email to

[Prev in Thread] Current Thread [Next in Thread]