From: Lukáš Jiřiště Date: Tue, 20 Aug 2024 13:30:57 +0000 (+0200) Subject: Add legend, axes labels and time to the plot X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=4b2ed3c7f77f91dc687239d9850d478f9b3ed191;p=Bubble_column.git Add legend, axes labels and time to the plot --- diff --git a/Bubliny.m b/Bubliny.m index 5db35aa..e623cf6 100755 --- a/Bubliny.m +++ b/Bubliny.m @@ -58,7 +58,7 @@ for i=1:nSelectedDirectory wait_bar = waitbar(0, ''); set(gca(wait_bar).Title, 'Interpreter', 'none'); - intensity = []; + start_time = name_to_time(FFiles(1).name); startFile = 1; endFile = numel(FFiles); step = 1; @@ -70,12 +70,16 @@ for i=1:nSelectedDirectory waitbar(j/N, wait_bar, 'Proccessing the images'); intensity = mean(double(Figure), Weights = mask); [water(j), bubble_top(j), bubble_bot(j)] = get_levels(intensity); + time(j) = name_to_time(ImageName) - start_time; end close(wait_bar); waitbar(i/nSelectedDirectory, main_wb); figure - plot(meter([water; bubble_top; bubble_bot]')); + plot(seconds(time), 100 * meter([water; bubble_top; bubble_bot]'), 'LineWidth', 3); + legend('Water level', 'Bubble top', 'Bubble bottom','Location', 'north'); + xlabel('Time (s)'); + ylabel('Height (cm)'); end close(main_wb);