Problem with holding plot

Hi
I'm new with mat lab GUI so I have maybe simple question.
With one push button I'm plotting some curves and that works just fine, but I also have another check box for plotting additional line (if check box is 1 line is plotted if 0 line isn't plotted).
Question is how to hold first plot when check box is active, because in my case when I press push button curves are plotted but when check box is active line is plotted but previous curves are deleted.
Thank you

댓글 수: 2

Maybe I'm mis-understanding the question, but can't you just turn
hold(AxisHandle, 'on');
after you create the plot, where AxisHandle is the handle to the axes you want. Or is there something more complicated going on that I'm not getting?
Matt
toni
toni 2012년 7월 18일
편집: toni 2012년 7월 18일
h=handles.axes1;
x=[0,1000];
y=[0,1000];
hold on;
a=plot(h,x,y);
if get(handles.checkbox1, 'Value')==1
set(a,'Visible','on')
elseif get(handles.checkbox1, 'Value')==0
set(a,'Visible','off')
end
Here is the callback of the check box. I added hold on but problem is now that if check box it true or false line is plotted. What I need is, if the check box is true line is plotted with previous plotted curve and if check box is false line isn't visible but curves must stay.
Thanks

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

태그

질문:

2012년 7월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by