From your question I infer that you want to set the x-axis labels from -180 to 180, and the y-axis labels from -90 to 90. To do this, you should change the XTickLabel
and YTickLabel
properties of the axis object (note that you'll also need to adjust the number of ticks in each axis by modifying the XTick
and YTick
properties accordingly).
So, assuming that your image is stored in the matrix data
and you display it with imagesc(data)
, here's how to change the tick labels in the x-axis to be from -180 to 180:
xticklabels = -180:20:180;
xticks = linspace(1, size(data, 2), numel(xticklabels));
set(gca, 'XTick', xticks, 'XTickLabel', xticklabels)
Similarly, here's how to change the tick labels in the y-axis to be from -90 to 90:
yticklabels = -90:20:90;
yticks = linspace(1, size(data, 1), numel(yticklabels));
set(gca, 'YTick', yticks, 'YTickLabel', flipud(yticklabels(:)))
This is what it should look like:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…