I am using the following code to find the position of the xlabel in a figure of matlab.
xlabel('X');
get(get(gca,'XLabel'),'Position');
which gives me some coordinates (0.4981 -0.0669 1.0001). I think that coordinate is just the position of the top-left point of the label. So how do I found the bound for the label if I know the fontsize only?
Text objects have an “Extent” property: