Hello,
From my understanding of your question, you wish to display an image which will take up the entire space within the figure in an App Designer app. Consider the following code:
app.UIAxes.Position = [0 0 app.UIFigure.Position(3:4)];
title(app.UIAxes, []);
xlabel(app.UIAxes, []);
ylabel(app.UIAxes, []);
app.UIAxes.XAxis.TickLabels = {};
app.UIAxes.YAxis.TickLabels = {};
I = imshow('Flower.jpg', 'Parent', app.UIAxes, ...
'XData', [1 app.UIAxes.Position(3)], ...
'YData', [1 app.UIAxes.Position(4)]);
app.UIAxes.XLim = [0 I.XData(2)];
app.UIAxes.YLim = [0 I.YData(2)];
This programmatically resizes and repositions the axes to fill the entire figure window. It then removes the axes title as well as the axis labels and tick labels for each axis, allowing the axes to fill the figure as much as possible.
Then, the image is displayed, and instructed to stretch to fill the axes by setting the 'XData' and 'YData' properties.
Finally, the limits of the axes are set so that no additional space is padded around the image.
If, instead of filling the entire figure, you just wish to fill the entire axes with the image, you should be able to just remove the first line.
Best Answer