copyUIAxes

버전 4.0.1 (193 KB) 작성자: Adam Danz
Copy UIAxes (eg. AppDesigner) and most properties to a new figure and recreate the legend and colorbar if they exist.
다운로드 수: 1.8K
업데이트 날짜: 2021/3/17

라이선스 보기

편집자 메모: This file was selected as MATLAB Central Pick of the Week

Use copyUIAxes() to copy plots in AppDesigner or any UIAxes onto regular axes which can be easily saved, printed, or modified.

copyUIAxes copies all children and most properties of a UIAxes to regular axes. If the UIAxes has a legend or colorbar, they can be recreated in the new axes, too.

copyUIAxes(ax) creates a new figure and copies the UIAxes (ax) content to the new figure.

copyUIAxes(ax, destination) copies the UIAxes to the destination which can be a figure or axis handle.

copyUIAxes(ax, 'copyPosition', true) will copy the position properties so the copied axes have the same position relative to the figure as the UIAxes or App.

See the file's help section and the demo document for other optional inputs and demos.

--------------------------------Notes--------------------------------
In r2020a Matlab released exportgraphics() and copygraphics() which can be used to copy uiaxes and uifigures which makes parts of copyUIAxes() obsolete.

For discussion on this topic:
https://www.mathworks.com/matlabcentral/answers/281318-how-can-i-save-a-figure-within-app-designer

인용 양식

Adam Danz (2024). copyUIAxes (https://www.mathworks.com/matlabcentral/fileexchange/73103-copyuiaxes), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2019b
R2016a에서 R2020b까지의 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Develop Apps Using App Designer에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
4.0.1

Fixed error with Matlab version check in r2021a.

4.0.0

Now supports yyaxis plots & copies subtitles. PositionConstraint no longer copied.

3.0.0

copyPosition input added to copy the axes position within the figure. Other minor changes.

2.0.0.1

Updated release compatibility fields; no changes to code.

2.0.0

Updated for changes made to Matlab r2020a

1.2.0.1

Announcement: Update for r2020a coming soon.

1.2.0

Now works with categoricalHistograms; new warning message appears if there's a problem copying a property; drawnow() added prior to copying; axis visibility is set at the end only when the UIAxis visibility is 'on'.

1.1.1

Changed thumbnail image only.

1.1.0

Destination figure handle returned in output structure; improved error handling; improved listIgnoredProps text.

1.0.1

Edited description; no change to code.

1.0.0