M.Laloux septembre 2014
Procédure:
%load_ext oct2py.ipython
%%octave -s 1400,467 -f png
subplot(121);
[x, y] = meshgrid(0:0.1:3);
r = sin(x - 0.5).^2 + cos(y - 0.5).^2;
surf(x, y, r);
%octave_pull x y r
load_ext rpy2.ipython
%Rpush x y r
%%R
library(plot3D)
surf3D(x = x,
y = y,
z = r ,
colkey=FALSE,
bty="b2",
main="fonction définie dans Octave et tracée avec R")
%Rpull x y r
%matplotlib inline
from mpl_toolkits.mplot3d.axes3d import *
import matplotlib.pyplot as plt
from matplotlib import cm
fig = plt.figure()
ax = Axes3D(fig)
ax.plot_surface(x, y, r, rstride=1, cstride=1, cmap=cm.jet,linewidth=1, antialiased=True)
plt.show()