Re: drawnow function problem




"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


.



Relevant Pages

  • Re: drawnow function problem
    ... How can I get solid line when using a drawnow function. ... I get the graph ... set(h, 'XData', x, 'YData', y); ...
    (comp.soft-sys.matlab)
  • Re: GUI data
    ... Depending on the kind of graph you created, ... see the XData and YData and ZData properties of: ...
    (comp.soft-sys.matlab)
  • drawnow function problem
    ... How can I get solid line when using a drawnow function. ... I get the graph ... but it is plotted with dots. ... My english is not very good.. ...
    (comp.soft-sys.matlab)