Use copyobj for specific properties -> subplot
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello everyone, at the moment I'm trying to create a callback function which copies the main properties of some of my GUIs axes to a subplot in a new window. The problem is that I don't know how to select just some specific properties and leave out others. My callback works fine with
plotdata= findall(handles.axes1);
plotdata=plotdata(2:end);
%or plotdata=get(Axeshandle,'children'); but this doesn't give me the labels for example
sp=subplot(2,2,[1,3]);
copyobj(plotdata,sp);
but in this case it also copies the locations of the labels so that they seem misplaced on my subplot. The properties I'm interested in copying are: -xlim -ylim -xtick -ytick -the plot(with colour) -xlabel(with colour, font and size) -ylabel (with colour, font and size)
The rest, like the position of the subplot, should remain as in the default subplot-settings.(so that labels do not cross each other)
Is there a way to get all properties mentioned above into a structure which I can copy with copyobj?
And a second questions relating to this is whether there is a command to clear the subplot before using copyobj.
At the moment the plots overwrite each other. (I tried "cla;" but this clears all the subplots and not a particular one. "clear subplot(2,2,[1,3]);" doesnt work either.) It works if I do it with the subplot handles and always delete the handle previously to the plotting but then I also have to check if the subplot handle exists, which gives me another ifloop and kind of seems too complex for such a simple task)
Thank you for your help! Klaus
답변 (1개)
Jan
2015년 5월 30일
The documentation of cla reveals, how to clear the contents of a specific axes:
axesH = subplot(2,2,[1,3]);
cla(axesH);
참고 항목
카테고리
Help Center 및 File Exchange에서 Subplots에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!