I am trying to get the location of axis TickValues from a MATLAB figure. For example, I have a figure as follows:
I am trying to find the location of axis TickValues after I save the figure as an image (shown in figure) [Note: The bounding boxes are handcrafted. Ignore any error]
Here is the code I generated so far:
h = plot(1:10);
hFrame = getframe(h.Parent.Parent);
hImage = hFrame.cdata;
set(h.Parent,'Units','pixel');
I am trying to get bounding boxes for x-axis TickValues and y-axis TickValues on hImage
from the position
of h.Parent.
Let me know if the question is not clear yet. I will edit to make it clearer.
getframe(h.Parent)
to save just the part that doesn't include the labels? You probably don't need to save to an image though if you just want the locations of theaxes
. Just useh.Parent.Position
to get that. – Suever