Re: drawnow function problem
- From: "Tomy" <alcatraz@xxxxxx>
- Date: Fri, 31 Aug 2007 15:20:38 +0200
"Steven Lord" <slord@xxxxxxxxxxxxx> wrote in message
news:fb94c5$e6r$1@xxxxxxxxxxxxxxxxxxxxx
"Tomy" <alcatraz@xxxxxx> wrote in message
news:fb92m3$4pq$1@xxxxxxxxxxxxxxxxxx
How can I get solid line when using a drawnow function. I get the graph
which I want, but it is plotted with dots. I am using semilogy function
to draw graph.
This is part of code:
semilogy(q,a(t));
drawnow;
hold on;
grid on;
semilogy(q,a(t),'-'); --- this doesn't work too
Sorry, if I wrote something wrong. My english is not very good..
Each call to SEMILOGY is creating a new line containing just one point.
Instead, create one line and update its data.
h = semilogy(1, 1);
axis([1 100 1 100]);
for k = 2:100
xdata = get(h, 'XData');
ydata = get(h, 'YData');
set(h, 'XData', [xdata k], 'YData', [ydata k]);
pause(0.2)
end
or
x = NaN(1, 100);
y = NaN(1, 100);
h = semilogy(x, y);
axis([1 100 1 100]);
for k = 1:100
x(k) = k;
y(k) = k;
set(h, 'XData', x, 'YData', y);
pause(0.2)
end
--
Steve Lord
slord@xxxxxxxxxxxxx
thanx
.
- References:
- drawnow function problem
- From: Tomy
- Re: drawnow function problem
- From: Steven Lord
- drawnow function problem
- Prev by Date: Re: drawnow function problem
- Next by Date: calculating SNR from psd
- Previous by thread: Re: drawnow function problem
- Next by thread: compression of sound
- Index(es):
Relevant Pages
|