This repository has been archived on 2021-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
scientificComputing/projects/project_eyetracker/solution/plot_image_position_overlay.m

21 lines
468 B
Matlab

function fig = plot_image_position_overlay(x, y, time, image)
if length(x) ~= length(y) || length(y) ~= length(time)
error("Length of vectors x, y, and time does not match!");
end
if ~exist(image, "file")
error("Image %s could not be found!", image);
end
fig = figure();
imshow(image)
hold on
scatter(x, y, [], time)
c = colorbar();
fig.PaperSize = [10.0, 10.0];
fig.PaperPosition = [0., 0., 10.0, 10.0];
c.Label.String = "time [s]";
c.Label.FontSize = 9;