How to change image axis labels

I am trying to change the labels of the image axis with some latitude / longitude, but I cannot find how to do this. I tried some basic commands like:

imagesc(data)
axis(meshgrid([-180:20:180],[-90:20:90]))
colorbar

but this expression appeared:

imagesc (data), axis (meshgrid ([- 180: 20: 180], [- 90:20:90])), colorbar Operands to || and && operators must be converted to a logical value scalar.

Error in axis>allAxes (line 448)
result = all(ishghandle(h)) && ...

Error in axis (line 57)
if ~isempty(varargin) && allAxes(varargin{1}). 

Can someone help me? FYI, my image axis labels are the data order (0 to N).

My desired results are an image similar to a world map, with grid / grid lines as axes. It should look like this :

enter image description here

+5
source share
2 answers

, x -180 180, y -90 90. XTickLabel YTickLabel ( , , XTick YTick).

, , data, imagesc(data), , x -180 180:

xticklabels = -180:20:180;
xticks = linspace(1, size(data, 2), numel(xticklabels));
set(gca, 'XTick', xticks, 'XTickLabel', xticklabels)

, Y -90 90:

yticklabels = -90:20:90;
yticks = linspace(1, size(data, 1), numel(yticklabels));
set(gca, 'YTick', yticks, 'YTickLabel', flipud(yticklabels(:)))

:

enter image description here

+10

, , , . label , xlabel ylabel, :

xlabel('time [sec]'); ylabel('Amplitude');

, - :

plot(1:4)
set(gca,'Xtick',1:4,'XTickLabel',{'a', 'b', 'c', 'd'})

imagesc, :

set(gca, 'YDir', 'reverse');

Ticks, ...

+2

All Articles