MATLAB: How to create a Contour plot such as below with three interdependent variables

colorcontourplotsthree variables

Best Answer

time = readmatrix('Book1.xlsx', 'Range', 'A2:A202');
dp = readmatrix('Book1.xlsx', 'Range', 'C1:J1');
logDp = readmatrix('Book1.xlsx', 'Range', 'C2:J202');
ax = axes();
contourf(time, dp, logDp.')
colormap(jet)
xlabel('Time');
ylabel('Dp');
ax.ColorScale = 'log';
cb = colorbar(gca, 'Location', 'south');
ax.Position(2) = ax.Position(2) + 0.2; % move axis up
ax.Position(4) = ax.Position(4) - 0.2; % decrease the height
cb.Position(2) = cb.Position(2) - 0.18; % move the colorbar down