Hi,
Thank you in advance for your help.
I'm creating a plot in MATLAB which is then saved and loaded as a background image in other software. The other software then places overlays on top of the background image to create a user output. This other software needs to scale the overlayes to align with the background image, which creates the fairly unique problem I'm struggling with.
Say I have a plot that goes from 0 to 15 in the X axis and 0 to 7 on the Y axis. I need to calculate, if those axis were extended to the full size of the saved figure, what would the axis limits be?
So far I've written code to get the pixel size of the axis and the number of ticks. Then I calculate the number of ticks per pixel, them multiple that by the number of pixles in the figure. This gets me close but not perfect. I'm a little out. So I expect there is something else in the figure rather than just the axis which is taking up pixels.
For example.
If run spy I get this image:
…which is in a figure that's much larger than the axis. If I were to extend the axis to the edge of the figure, then what would be the min and max of each axis?
Its roughly this: (Which i did in paint)
In heindsite spy is perhaps a bad example image as the Y counts down but hopefully it gets my point across.
Thank you!
Best Answer