itom2dqwtplot axisOffsets

Create issue
Issue #124 wontfix
Oliver Schwanke created an issue

Hi there,

would it be a good idea to also take dataObject’s axisOffsets into account when plotting?

Or is there already any way on how to do this? The doc states it would support the axisoffsets…

This would e especially cool for coordinate retrieval tasks through shapes from plot, because for now it is safer to set axisOffsets zero and apply coordinate shifts manually…

from itom import *
d = dataObject((100,100))
d.axisScales = (0.1, 0.1)
d.axisOffsets = (-5, -5)
plot(d)

expected ouput:

realer output:

itom itom 3.2.1

Comments (4)

  1. M. Gronle

    Hi Olli,

    the axis offsets are considered in the plot, however the offsets are not given in physical coordinates but in “pixels”,
    therefore the origin of the real output image is 0.5 | 0.5 and not 0|0. This is correct.

    The relationship between physical coordinates (the ones, displayed in every plot) and pixel coordinates is:

    x_phys = (x_pix - x_offset) * x_scale
    

    This can also be seen in the docstrings of

    dataObject.physToPix or dataObject.pixToPhys, which can be used to transform from one coordinate
    system to the other one.

    Therefore, the 0|0 pixel in your example results in a physical coordinate of (5*0.1 | 5*0.1) = (0.5|0.5).

    P.S. I guess this issue would better fit to the issues of the designer plugins repository. Just for the future 😉

    Cheers

    Marc

  2. Oliver Schwanke reporter

    Hi Marc,

    thanks for the info.

    I think the dataType made me believe it to be in units not pixels...

  3. M. Gronle

    Hi Olli,

    you are right. I am also sometimes confused about this. The meaning of offset and scale has been defined in the first days of itom and has been taken from our previous software 😢

    I will close this issue.

    Cheers

    Marc

  4. Log in to comment