Here are the changes I suggest you make. Lines that have been commented-out are lines you don't seem to need.
The key changes are setting the x and y values in contourf() instead of setting tick labels and removing the log scale for the colorscale.
I've left additional comments in all caps with further explanation.
M_2f1=[0.0149766610154867,0.0148727404855169,0.0149659744686933,0.0197882778625291,0.0184313013563117,0.0176794194615834,0.0196108762871584,0.0258284889924015,0.0354233801633032,0.171924195188659,0.0281396699959042,0.0141469884838954,0.0334375924402216,0.0314806724042401,0.172885272977384,0.0883818321056840,0.106217236988698,0.0782668761035103,0.122073669629712,0.0274013525228684,0.0485163365474854;0.0250969531529632,0.0139275587788499,0.0130272875683284,0.0198185099934251,0.0258483008607248,0.0216474128550250,0.0260883732887959,0.0329091753710079,0.0268783125653000,1.91538463836732,0.195449696327352,0.0381036869089853,0.0588836876081499,0.171757614634871,0.0231260787399225,0.170935395044788,0.120483617869003,0.600468182457506,0.166605755383242,0.318424884533997,0.0370178336952820;0.0127170974716373,0.0147177357124663,0.0142949618281963,0.0141321097009308,0.0135950246696883,0.0155180804843015,0.0128687984781713,0.0162524560391073,0.0149971936741940,0.0137489964554028,0.0328922058840716,0.0135826966044079,0.0147869975187494,0.0136696060929059,0.0133113468539191,0.0684702636256040,0.0644115870564511,0.359497603819481,0.0386968843910783,0.0148698983598170,0.0194361839183835]
f = figure(1);
axes1 = axes('Parent',f);
hold(axes1,'on');
[C,h]=contourf(0:2.5:50, 1:3, log(M_2f1),15);
h.LineWidth = 0.0001;
box(axes1,'on');
set(axes1,'BoxStyle','full','Layer','top');
c = colorbar(axes1);
c.Label.String = 'Nonlinearity parameter';
xlabel('X-direction [mm]')
ylabel('Y-direction [mm]')
One reason the image seems stretched vertically is because of the scaling difference between the x and y axes. That could be addressed by equating the aspect ratio using axis(axes1, 'equal') but then your axis height will be narrow.
Best Answer