enthought / enthought/mayavi

mlab.imshow positions the image incorrectly

Open
#451 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
316
Avg merge
7h 44m
Merged PRs (30d)
5

Description

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.

```
im = mlab.imshow(image,
extent = [0, 50, 0, 50, 0, 0],
interpolate=False, opacity=.3)
```

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.

```
im.actor.orientation = [90, 0, 0]
im.actor.position = [25, 0, 25]
im.actor.scale = [.5, .5, .5]
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.