plotyy messing up my gui
이전 댓글 표시
I have a gui that has many buttons that plot something after pressing each button. All plots have the same dimension and are plotted on the same frame. So I decided to have one of these plots contain two graphs, using plotyy since the second graph has a different y axis. Now when I press a button, my plots come out bigger and outside the original frame. I managed to fix that but the new plots have the new axes and the old axes superimposed on them. I have tried to understand handles but it's like a foreign language to me. Does anyone know how I can eliminate the AX(2) properties? This seems to be the one messing me up. I just want all my buttons to plot in the correct spot.
채택된 답변
추가 답변 (1개)
Jan
2012년 7월 8일
The question is not clear to me. Perhaps understanding the handle concept allows you to solve the problem already: A "handle" is a value of type double (but it could be any other type also, e.g. a string, but this detail does not matter), which addresses each GUI object unequivocally. Using this handle allows to set the properties of an object later on or to use a specific object as parent of others.
Axes1H = subplot(1,2,1); % Now AxesH is the AXES object
Axes2H = subplot(1,2,2);
% Show all properties:
get(Axes1H)
% Set a specific property:
set(Axes2H, 'Color', [1,0,1]);
% Draw to a specific axes:
LineH = line(1:10, rand(1,10), 'Parent', Axes1H);
% Show properties of the line:
get(LineH)
Now consider that plotyy creates two axes, while the one in the foreground has a transparent background color. Perhaps you can use the two axes handles replied by plotyy to perform, what you want.
카테고리
도움말 센터 및 File Exchange에서 Combine Multiple Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!