[yt-dev] Issue #1337: annotate_scale does not work for non-unity aspect ratio (yt_analysis/yt)

Hsi-Yu Schive issues-reply at bitbucket.org
Tue Mar 21 11:09:50 PDT 2017


New issue 1337: annotate_scale does not work for non-unity aspect ratio
https://bitbucket.org/yt_analysis/yt/issues/1337/annotate_scale-does-not-work-for-non-unity

Hsi-Yu Schive:

The annotate_scale() function does not work when the aspect ratio is not unity.

Example code:
```
#!python
import yt
from yt.units import kpc
ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
slc = yt.SlicePlot(ds, 'z', 'density', center=[0.5, 0.5, 0.5],
                   width=(15*kpc,20*kpc))
slc.annotate_scale(coeff=2.0, unit='kpc', pos=(0.1,0.1))
slc.save()
```

The code works fine when changing the width to (20\*kpc,20\*kpc).




More information about the yt-dev mailing list