Hi. I am currently working on embeding a plot in GUI. I want to see the plot inside the gui interface not in the figure box. I achieved to embed the figure into the interface but when I also want to save it by saveas the image i get turns out to be depending on the position of the axes in the gui workspace. I mean if I slide axes trough the edges of the workspace I get no image or if I approach it to the edges I might get half of the plot from the file where the plot is saved. The following code does what I provided above. All help that you are going to provide is well appreciated.
"""""
function pushbutton1_Callback(hObject, eventdata, handles)
axes(handles.axes1);
box(gca,'on');
A=[1 2 3 4 5 6];
B=[0 1 0 -1 0 1];
plot(A,B)
saveas(gcf,['STEP' num2str(1+9999) '.png'],'png');
""""""

댓글 수: 1

Ragunanth Venkatesh
Ragunanth Venkatesh 2017년 8월 2일
fh = figure;
copyobj(handles.axes1, fh);
just use this and then u will open the figure from the gui as a seperate figure, and then you can save it using save as.

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Exploration에 대해 자세히 알아보기

태그

질문:

2013년 9월 3일

댓글:

2017년 8월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by