From: Sahra winter on
How can I use bar plotting function in a while loop & have it plot one bar per loop & SHOW all the bars as the new bars are forming?
I have the same problem when I'm using plot as well.

any help would be appreciated
From: ImageAnalyst on
Sahra winter:
Copy and paste this demo:

clc;
close all;
clear all;
workspace; % Display workspace panel.
numberOfDataPoints = 7;
data = rand(1,1);
k = 1;
while k <= numberOfDataPoints
bar(data);
if k == 1
set(gcf, 'Position', get(0,'Screensize')); % Maximize figure.
end
xlabel('Bin Value', 'FontSize', 16);
ylabel('Y Value', 'FontSize', 16);
title ('Bar Chart', 'FontSize', 16);
if k < numberOfDataPoints
message = sprintf('Click OK for bar #%d', k+1);
uiwait(msgbox(message));
data = [data rand(1,1)];
end
k = k + 1;
end

figure;
data = rand(1,1);
k = 1;
while k <= numberOfDataPoints
plot(data, '-ro', 'LineWidth', 2);
if k == 1
set(gcf, 'Position', get(0,'Screensize')); % Maximize figure.
end
xlabel('Bin Value', 'FontSize', 16);
ylabel('Y Value', 'FontSize', 16);
title ('Line Plot', 'FontSize', 16);
if k < numberOfDataPoints
message = sprintf('Click OK for point #%d', k+1);
uiwait(msgbox(message));
data = [data rand(1,1)];
end
k = k + 1;
end


From: Sahra winter on
Thanks for your help.
 | 
Pages: 1
Prev: Import Problems
Next: dlmread precision