I have a plot in MATLAB app designer with 3 UIaxes which means I have 3 plots actually. I want copy all 3 of them into one figure so that I can save all of them together. How can I do that. Thank you.

댓글 수: 4

Mario Malic
Mario Malic 2023년 9월 6일
Check copyobj and tiledlayout functions.
How do I do this exactly?
I tried this
newFigure =tiledlayout(1,3);
copyobj(app.UIAxes2_1,newFigure);
newFigure2 =tiledlayout(2,3);
copyobj(app.UIAxes2_2,newFigure2);
newFigure3 =tiledlayout(3,3);
copyobj(app.UIAxes2_3,newFigure3);
and I get error : "Object Copy of Axes with multiple coordinate systems is not supported".
Can I know the correct way to do it.
Mario Malic
Mario Malic 2023년 9월 6일
편집: Mario Malic 2023년 9월 6일
In this case, then I would export three pictures with exportgraphics as an image format and just combine them in one image by loading each of them in a variable and align them next to each other.
Otherwise create a separate tab with different uiaxes that you would plot the results to and use exportgrapics to export the complete uifigure.
In this case, then I would export three pictures with exportgraphics as an image format and just combine them in one image by loading each of them in a variable and align them next to each other.
do you know any link on how to do this. I cant find any.

댓글을 달려면 로그인하십시오.

답변 (1개)

Mario Malic
Mario Malic 2023년 9월 7일

0 개 추천

Hey,
Solution for combining the image is below. If you need some space in between, you can add white space, by creating array that corresponds to white color with matrix values of 255 for each channel (R, G, B) values.
image = imread("DistortedImage.png");
combImage = [image, image];
imshow(combImage)
imwrite(combImage, "img.png")

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by