enthought / enthought/mayavi

Axes don't scale on mlab.savefig(..., magnification=2)

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

Description

Axes don't scale when a figure is saved with mlab.savefig and magnification > 1. This is reproducible with version 4.4.0 from anaconda as well as the current git master branch on OS X using the pyqt, pyside, and wx backends.

```
from mayavi import mlab
from numpy import random
from tvtk.api import tvtk

def view(dataset):
fig = mlab.figure(bgcolor=(1, 1, 1), fgcolor=(0, 0, 0),
figure=dataset.class_name[3:])
surf = mlab.pipeline.surface(dataset, opacity=0.1)
# extract edges is giving an attribute error with git version of mayavi
# mlab.pipeline.surface(mlab.pipeline.extract_edges(surf),
# color=(0, 0, 0), )
mlab.axes()

data = random.random((3, 3, 3))
i = tvtk.ImageData(spacing=(1, 1, 1), origin=(0, 0, 0))
i.point_data.scalars = data.ravel()
i.point_data.scalars.name = 'scalars'
i.dimensions = data.shape
view(i)

mlab.show()
mlab.savefig("snapshot_1x.png", magnification=1)
mlab.savefig("snapshot_2x.png", magnification=2)
```

snapshot_1x.png:

![snapshot_1x](https://cloud.githubusercontent.com/assets/1207168/13686982/c290869e-e6e6-11e5-8145-6764c4c81e62.png)

snapshot_2x.png:

![snapshot_2x](https://cloud.githubusercontent.com/assets/1207168/13686989/c71de008-e6e6-11e5-8c1c-069d00f6d54c.png)

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.