MATLAB: Matlab adds additional margin to an image!

image margins

I'm going to develope an app for calculating beam deflections. for inserting images of supports, when I insert the images matlab automatically adds unwanted margins to my pictures.Does anyone know how can I solve this issue?
Screen Shot 2019-05-28 at 10.15.35 PM.png

Best Answer

Amin - from your code
ax = uiaxes(fig,'position',[78 120 240 240]);
imshow('Support1.png','parent',ax);
ax = uiaxes(fig,'position',[220 120 240 240]);
isn't the first axes created at x-coordinate 78 with a width of 240? So that would mean that 78+240=318...but the second axes is created at x-coordinate 220 which is less than 318 which leads to overlap amongst the two axes. Maybe you need to create the second axes at least at x-coordinate 318 so that there is no overlap between the two.