Matlab App designer AXIS NOT SHOWING MULTIPLE IMAGES

1 view (last 30 days)
Hi, normally we show multiple images using subplot, is there any way to use to display multiple images in one AXES in MATLAB APP DESIGNER.? Say if I want to run a loop and retrieve the images from selected folder, how to DISPLAY ALL IN ONE AXES. I am using MATLAB APP DESIGNER

Accepted Answer

Benjamin Thompson
Benjamin Thompson on 15 Feb 2022
This section from the documentation article "Display Graphics in App Designer" may be helpful:
Use Functions That Don't Support Automatic Resizing
App Designer figures are resizable by default. This means that when you run an app and resize the figure window, components in the figure are automatically resized and repositioned to fit. However, some graphics functions do not support automatic resizing. To use these functions in App Designer, create a panel in which to display the output of the function and set the AutoResizeChildren property of the panel to 'off'. You can set this property in the Panel tab of the Component Browser or in your code.
For example, the subplot function does not support automatic resizing. To use this function in your app:
  1. Drag a panel component from the Component Library onto your canvas.
  2. Set the AutoResizeChildren property of the panel to 'off'.
  3. Specify the panel as the parent container using the 'Parent' name-value argument when you call subplot. Also, specify an output argument to store the axes.
  4. Call the plotting function with the axes as the first input argument.
app.Panel.AutoResizeChildren = 'off';
ax1 = subplot(1,2,1,'Parent',app.Panel);
ax2 = subplot(1,2,2,'Parent',app.Panel);
plot(ax1,[1 2 3 4])
plot(ax2,[10 9 4 7])
Other commonly used functions that do not support automatic resizing include pareto and plotmatrix.
For more information about managing resize behavior, see Alternatives to Default Auto-Resize Behaviors.
Other possibilities could be to use imtile or montage to combine your images together into one image and have your App display that.

More Answers (0)

Categories

Find more on Specifying Target for Graphics Output in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!