MATLAB: Set Image Axis as Primary Axis

axisimage

I have a figure of a plot/graph I would like to load into MATLAB (first figure below) that has its own axes. I would like to make these axes my working axes as I need to plot data on top of this graph at particular points corresponding to the figure's axis. However, when I load the image, MATLAB generates it's own axis(second figure). If it wasn't for the fact that the figure axis is on a log-log scale, this might not be a problem.
Any help would be appreciated it. Thanks!

Best Answer

Following example show how to synchronize the image axis with the MATLAB plot axis
im = imread('image.jpeg');
fig = figure();
h = imshow(im);
ax_img = gca;
ax_plot = axes();
hold(ax_plot);
ax_plot.Color = 'none';
ax_plot.Position = [0.183 0.158 0.678 0.778]; % bit of trial and error
ax_plot.XLim = [1 100];
ax_plot.YLim = [0.005 1];
ax_plot.XScale = 'log';
ax_plot.YScale = 'log';
% Example: give values in image coordinates
plot(ax_plot, [1 5 10 50 100], [0.005, 0.05, 0.1, 0.5, 1], 'r', 'LineWidth', 2);
ax_plot.Visible = 'off';