필터 지우기
필터 지우기

GUI Plotting "hold on" problem

조회 수: 4 (최근 30일)
John
John 2011년 11월 9일
So my GUI contains two axes and multiple checkboxes. If the user checks on a checkbox part of the corresponding data for that checkbox is graphed in one axis while the other half is graphed in the other axis. This works fine. The problem I am having is that when the user selects another checkbox whatever was graphed before is cleared and the new set of data is plotted only. I have tried using the "hold on" feature however for some reason this distorts the x and y scale of my axes (the graphs I am using are loglog and by using "hold on" they get distorted to a regular plot scale) Please help .
p1 = loglog(handles.inplane_graph,freq,ip_yvalues_accep,'g',freq,ip_yvalues_proto,'b');
p2 = loglog(handles.outofplane_graph,freq,oop_yvalues_accep,'g',freq,oop_yvalues_proto,'b');
hold on
So I added the above code in one of my checkboxes, however now when the other checkbox is checked, my 'outofplane_graph' is the only axes that actually holds on to whatever was graphed before it. My 'inplane_graph' axes deletes whatever was graphed before it and graphs the new set of data. I want both of my axes to hold on. Any ideas?

채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 11월 9일
Do you mean just "hold on" command will distort the scale, or the new plots added changed the scale? You can always change the scale as you want using axis(), xlim(),ylim() if the scale is changed due to the added new plots.
f=figure(1);
loglog(1:10000);
hold on;
plot(10000:-1:1);
xlim([1 10000]);
  댓글 수: 3
Fangjun Jiang
Fangjun Jiang 2011년 11월 9일
Use hold(axes_handle,'on')
John
John 2011년 11월 9일
yep I did this right before you recommended it to me haha. Thank you though.

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2011년 11월 9일
Try using "hold all" instead of just "hold on".

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by