With mayavi 4.5.0, setting the extent of an image while calling imshow does not cause an exception like it did before (see issue #37 ). But still, specifying the extent keyword does not have the expected effect. In the following example, the image is incorrectly placed in the xy-plane, instead of the xz-plane as specified. The scaling is also wrong.
import numpy as np
from mayavi import mlab
image = np.random.random((100,100))
im = mlab.imshow(image,
extent = [0, 50, 0, 0, 0, 50],
interpolate=False, opacity=.3)
mlab.axes(im)
On the other hand, specifying the extent within the xy-plane works as expected.
The image positioning above could be accomplished with something like what follows, but that's very involved and requires too much maths for easy application. Also, it has to be done afterwards as imshow lacks these kwargs.
With mayavi 4.5.0, setting the
extent
of an image while callingimshow
does not cause an exception like it did before (see issue #37 ). But still, specifying theextent
keyword does not have the expected effect. In the following example, the image is incorrectly placed in the xy-plane, instead of the xz-plane as specified. The scaling is also wrong.On the other hand, specifying the extent within the xy-plane works as expected.
The image positioning above could be accomplished with something like what follows, but that's very involved and requires too much maths for easy application. Also, it has to be done afterwards as
imshow
lacks these kwargs.