How to save Matlab GUI-Window as vector graphics?
조회 수: 2 (최근 30일)
이전 댓글 표시
I want to save the whole Window of GUI as a vector graphic like these
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171262/image.png)
I tried to use
fig=openfig('test_gui.fig');
fig.InvertHardcopy = 'off';
set(fig,'PaperPositionMode','auto');
print(fig,'-dpdf','test_gui.pdf')
But only get the GUI-Frame without Figure in PDF
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171263/image.png)
How can I get both of them as a vector graphic ?
Thanks in advance
댓글 수: 0
답변 (1개)
Sonam Gupta
2018년 3월 26일
This is happening because the handle 'fig' in your code is pointing only to GUI frame. Use the following code instead:
if true
fig= test_gui.fig;
fig.InvertHardcopy = 'off';
set(fig,'PaperPositionMode','auto');
print(fig,'-dpdf','test_gui.pdf')
end
I hope this helps.
댓글 수: 3
Ashishkumar Gupta
2023년 1월 9일
편집: Ashishkumar Gupta
2023년 1월 9일
my Gui file name is plotgraph.mlapp. It does not have .fig extension.!! What's the workaround here?
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!