You can use imfuse function. It creates a composite image from two images. There are examples on this page explaining how to create overlay image.
% Generate some data for the compass plot
U = randn(1,50);
V = randn(1,50);
% Create the compass plot and save it as an image
% figure;
% Create a smaller figure for the compass plot
figure('Position', [100, 100, 150, 150]); % Adjust the size as needed
compass(U, V);
saveas(gcf, 'compass_plot.jpg');% Load or import your image
img = imread('<your-image-path>');
% Load the compass plot image
compass_img = imread('compass_plot.jpg');
% Use imfuse to overlay the compass plot image on the original image
overlay_img = imfuse(img, compass_img, 'falsecolor','Scaling','joint','ColorChannels',[1 2 0]);
% Display the overlay image
% figure;
imshow(overlay_img);
You can adjust the position of the compass plot in the figure function.