Saving figures with saveas function

조회 수: 5 (최근 30일)
Pacullo
Pacullo 2016년 4월 22일
댓글: Pacullo 2016년 4월 26일
Hello. I'm trying to save some figures I created in a GUIDE using saveas function with this code:
[filename,pathname] = uiputfile({'*.jpg'},'Select where to save figure');
hNew = figure;
copyobj(handles.axes1, hNew);
saveas(hNew,fullfile(pathname, filename),'jpg') ;
close(hNew)
It works "ok", but some plots, (depending on the distribution on my panel), are not centered when they are plotted or saved. Some of them I can't even see. It looks like the part that is "saved" is only a part of the lower left corner of the panel where all the figures are.
How can I save them independently and correctly, more or less centered? Or is there any way to "select" the parts that I want to save of the panel?
Thanks for your time.
  댓글 수: 2
Walter Roberson
Walter Roberson 2016년 4월 22일
Which operating system are you using, and which release? Also are you using a high resolution display (HDPI) ?
Pacullo
Pacullo 2016년 4월 26일
Sorry for the delay, I have windows 7 (Home premium) and I use matlab R2015a.
I checked the resolution display, and I disabled it and tried, but it looks the same.
The problem is with the copyobj function, it already copies it "wrong" to the new figure. Any other ideas?
Thanks for answering.

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

답변 (0개)

카테고리

Help CenterFile 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!

Translated by