필터 지우기
필터 지우기

Changing Axis in a GUI and Saving a figure in a GUI

조회 수: 2 (최근 30일)
Rhys
Rhys 2013년 6월 12일
Hi everyone I am having a bit of a problem with a GUI I am writing. The GUI plots a selected set of data from a list and has four editable text boxes that allows you to change the axes by changing a vector. The changing of the axes works well except when I change the axes it deletes the the plot in the axes window and I cannot plot new information on it. Any suggestions?
Second, I can not figure out how to take the axes and save it as a .jpeg. I think I should be using save(handle,'filename.jpg') I just can not figure out the correct handle to use.
Thanks!

채택된 답변

Hugo
Hugo 2013년 6월 12일
Dear Rhys Taus,
I might be wrong, but I think the problem is that you might be rewriting the axes instead of modifying them. To be explicit: Are you modifying the axes properties using the command set()?
Do the following:
1) When you define the axes with the command axes(... , ....), write instead:
haxes=axes(... , ...);
haxes is the handle of the axes you defined.
2) When you want to modify the properties of the axes, use:
set(haxes, propertyname , newvalue)
where propertyname and newvalue depend on what you want to modify. This command should not change what is plot, unless of course you change the properties 'XData', 'YData' or the alike.
3) For saving the axes, use:
saveas(haxes, 'filename.jpg', 'jpg');
Hope this helps. Best regards,
  댓글 수: 2
Rhys
Rhys 2013년 6월 12일
Thanks! I was just going from the GUIDE but after I programatically made my axes like you said it seems to be working great! Now I just need to mess with the size and position a little bit to make it look nice again! Thanks! -Rhys
Rhys
Rhys 2013년 6월 13일
Hi Hugo,
The axes worked perfectly and I have my GUI running and looking nice! I am still having problems with saving the plot itself. When I try
saveas(haxes, 'filename.jpg', 'jpg');
the whole GUI is saved. Is there anyway to save the plot only?
Cheers,
Rhys

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by