MATLAB Answers

How can I project my data onto a map?

3 views (last 30 days)
greg on 11 Jul 2019
Answered: Yogesh Khurana on 24 Jul 2019
I have a variable that is 576x360 that I have been plotting using imagesc and then a mask overlayed to outline the continents but I am wondering if I can plot my data on a real map projection rather than a rectangle. I have tried worldmap but am a bit unsure about how to get my data onto the map. Any tips or reccomendations would be greatly appreciated.


Sign in to comment.

Answers (1)

Yogesh Khurana
Yogesh Khurana on 24 Jul 2019
To get the data onto the map you can use uistack. uistack is used to reorder visual stacking of UI components. Using this function, you can shift the specified component (map) to another position(bottom) in the stack.
Refer to the following example for the same:
x = 1:500;
y = sind(x);
axis tight;
hold on
I = imread('640px-WorldMap.png');
h = image(xlim,-ylim,I);
You can refer to uistack documentation for more details:


Sign in to comment.





Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!