save GUI figure to pdf

조회 수: 9 (최근 30일)
Dominika
Dominika 2014년 5월 19일
댓글: Dominika 2014년 5월 20일
Hi,
I want to save the figure from GUI to pdf. Before saving I want to allow the user to choose the name and the folder where he wants to put the file. I try with this:
function Save_Callback(hObject, eventdata, handles)
% hObject handle to Save (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
orient landscape
file = uiputfile('*.pdf');
print(file, '-dpdf');
The problem is I cannot choose the destination path. The file is saved in the current folder only and one panel of my figure is missing.
How can I solve my problem?
Many thanks,
Dominika

채택된 답변

Roberto
Roberto 2014년 5월 19일
try several overloaded methods for UIPUTFILE
[file path] = uiputfile('*.pdf');
print([path file], '-dpdf');
  댓글 수: 1
Dominika
Dominika 2014년 5월 20일
Thanks Roberto, it worked.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by