Figure exported from GUI showing wrong position
古いコメントを表示
I wanted to export a figure generated in GUI by clicking a push button. The figure is plotted in axes1. So I wrote axes(handles.axes1) to specify which figure I wanted to export. The code did work. However, the exported figure is in the wrong position. It is showing a random position of the GUI interface. Any help will be highly appreciated!
function export_Callback(hObject, eventdata, handles)
% hObject handle to export (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
axes(handles.axes1);
[FileName, PathName] = uiputfile('*.eps', 'Save As');
Name = fullfile(PathName, FileName);
print(Name,'-depsc');
2 件のコメント
Please do not confuse the terms: "figure" means the complete window. "GUI" is a "graphical user interface", I guess you mean "GUIDE". Axes contain diagrams, plots, lines or images, but not "figures". "axes(handles.axes1)" specify the axes and implicitly the figure also, which is the parent of the axes. The exported EPS might be located on random positions on the paper, but I cannot imagine, that appears on different positions on the "GUI interface". Why do you specify the axes, when you export the complete figure?
Please explain exactly, what is appearing where. Does "random" mean, that this is not reproducible?
ChyaYan Liaw
2017 年 3 月 21 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Creating, Deleting, and Querying Graphics Objects についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!