필터 지우기
필터 지우기

plot to a particular axes

조회 수: 4 (최근 30일)
Rebecca
Rebecca 2013년 7월 22일
So I have a user interface where the user inputs some values with sliders and text boxes, then it computes some stuff and plots a figure. This consists of 2 subplots, each with 2 sets of data held on.
my problem is that the plot is the full size of the GUI, and not constrained to the axes (called axes5) as I want. How can I do this using subplot? - I've only seen examples using plot and the axes handle??
something likle this:
subplot(2,1,1);
hold on
plot(x,ar0,'-k','LineWidth',2);
plot(x,areas(end,:),'-r','LineWidth',2);
subplot(2,1,2);
hold on
[h0,z,f,D,h_alt] = VokalTraktM(ar0,lv*ones(length(ar0),1),50,5000);
[h1,z,f,D,h_alt] = VokalTraktM(areas(end,:),lv*ones(length(ar0),1),50,5000);
  댓글 수: 1
dpb
dpb 2013년 7월 22일
I've never done GUIs so this is a guess...
From subplot doc's
subplot(..., PROP1, VALUE1, PROP2, VALUE2, ...) sets the specified property-value pairs on the subplot axes. To add the subplot to a specific figure pass the figure handle as the value for the 'Parent' property
Or, if that doesn't bring joy you can always use the form to place the axes precisely where you want them and at a given size...
subplot('position',[left bottom width height]) creates an axes at the specified position in normalized coordinates (in in the range from 0.0 to 1.0)
The latter would be handiest to use if you were to encapsulate it in a helper function, probably.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by