1

How can the matlab function slice be replicated in matplotlib?

Consider the following piece of code from that page:

[X,Y,Z] = meshgrid(-2:.2:2);
V = X.*exp(-X.^2-Y.^2-Z.^2);

xslice = [-1.2,0.8,2];   
yslice = [];
zslice = 0;
slice(X,Y,Z,V,xslice,yslice,zslice)

Please do not suggest any solutions that depend on vtk, mayavi etc as it seems that these cannot be installed on the system for reasons not important here.

wander95
  • 1,298
  • 1
  • 15
  • 22

0 Answers0