
Hello again, I am using yt slices and projections with scale annotation. I have my plots in comoving units ("Mpccm/h") but whenever I want to use the same units for annotation: slc.annotate_scale(corner='lower_right', coeff=10, units='Mpccm/h'), yt does not recognize these units. Am I missing something or only the physical scale annotation is possible ? Thanks, Salome

Dear Salome, If you are already using comoving units while making a slice or projection plot, then there is no need to annotate scale in the plot with the same unit because it should already be reflected on the x- or y-axis of the plot until you switched it off. And I think for annotation purposes, the comoving distance units are not valid YT distance units. But you can use "Mpc", "kpc", "pc", "AU" etc. I hope this will help you. -Prateek On Sun, Apr 12, 2020 at 2:31 PM Salome Mtchedlidze <salomchedlidze@gmail.com> wrote:

Hello Preteek, yes, I know I can use the other distance units and agree that if you already have the comoving x and y maybe there is no need to annotate the comoving scale any more. However, if you remove the axis maybe will be necessary. Thanks you, Salome

Hi Salome, Thanks for reporting this; it was a bug. I've issued a pull request to fix it. You can see it here: https://github.com/yt-project/yt/pull/2536 Britton On Sun, Apr 12, 2020 at 5:37 PM Salome Mtchedlidze <salomchedlidze@gmail.com> wrote:

Hello Britton, I have implemented the changes you made in a pull request and now I can have Mpccm/h units on the plots. However, if I use slice plots without units: slc.annotate_scale(corner='lower_right', coeff=10) it anyways gives Mpc units for the scale annotation (see attached). The following way: slc.annotate_scale(corner='lower_right', coeff=10, unit='Mpccm/h') gives correct units. Salome

Hi Salome, This was yet another bug. Thanks for spotting and reporting. I've fixed this in a new PR: https://github.com/yt-project/yt/pull/2632 Britton On Thu, Jun 11, 2020 at 10:19 PM Salome Mtchedlidze < salomchedlidze@gmail.com> wrote:

Hello Britton, I think it is still not fixed. I have implemented those changes as well, but again: slc.annotate_scale(corner='lower_right') gives Mpc unit in the plot even if the width of the plot is in Mpccm/h. Salome

Hi Salome, Sorry for taking so long to reply. I cannot manage to reproduce behavior that seems incorrect. I'm working off the master branch of the github repository. For example, if I do: ds = yt.load('enzo_tiny_cosmology/DD0010/DD0010') p = yt.SlicePlot(ds, 'x', 'density') p.set_axes_unit('Mpccm/h') p.annotate_scale(corner='lower_right', coeff=5, unit='Mpccm/h') p.save() I get a scale bar that is 5 comoving Mpc/h long and it looks to be the correct size. All combinations of axes units and scale units look correct to me. If you can reproduce the incorrect behavior with the enzo_tiny_cosmology data, please send the commands you used and I'll try it out. Britton On Wed, Jul 22, 2020 at 1:50 PM Salome Mtchedlidze <salomchedlidze@gmail.com> wrote:

Hello Britton, Sorry for the late response. I meant that the commands: p = yt.SlicePlot(ds, 'x', 'density') p.set_axes_unit('Mpccm/h') p.annotate_scale(corner='lower_right', coeff=10) p.show() by default give the scale Mpc units even though the box is in Mpccm/h units.. But yes, as you said, providing "Mpccm/h" works correctly.. Salome

Hi Salome, Reviving this very old thread, I think I agree that the appropriate behavior in this case would be to use Mpccm/h on the scale bar. I've issued a pull request that does this: https://github.com/yt-project/yt/pull/2989 Britton On Fri, Sep 4, 2020 at 1:11 PM Salome Mtchedlidze <salomchedlidze@gmail.com> wrote:
participants (3)
-
Britton Smith
-
Prateek Gupta
-
Salome Mtchedlidze