Data cursor does not show lat and long values in a contourm plot (worldmap function)
이전 댓글 표시
I want to overlay a data set into North America. I used MATLAB's worldmap() function to get just North America and used plotm() to plot the coastline of North America from coast.mat(this file also comes with MATLAB). I then used contourm() to plot my data over the coast lines. The code below shows what I did.
hold on
h= worldmap('na');
c = load('coast.mat');
plotm(c.lat,c.long);
contourm(lat,long,value);
"lat" and "long" contain latitude and longitude and are of sizes,lets say 'm' and 'n'. "value" has the data to be plotted which is a matrix of size m x n. The data plots fine but the only problem is that when I use the data cursor, instead of seeing values used in plotting: latitude for "y", longitude for "x" and "value" for z I see really large numbers for x and y and always a 0 for z.
The return from
h=worldmap('na')
shows similar large values for XLimit and YLimit. I tried to change this to the coordinate limits but the graph basically disappeared with out any error.I also tried creating a custom data cursor but I could not get to accurately change the values to geo coordinates.
Any help would be appreciated!
답변 (1개)
Chad Greene
2015년 4월 27일
1 개 추천
댓글 수: 4
Bipush Osti
2015년 4월 27일
Chad Greene
2015년 4월 27일
In what way does it not work?
Bipush Osti
2015년 4월 28일
Chad Greene
2015년 4월 28일
편집: Chad Greene
2015년 4월 28일
Strange! I'm afraid I don't understand that warning at all. Does this work for you?
hold on
h= worldmap('na');
c = load('coast.mat');
plotm(c.lat,c.long);
z = peaks(180);
[long,lat] = meshgrid(-179:0,89.5:-.5:0);
contourm(lat,long,z);
[lat_loc,lon_loc] = inputm(1);
t = textm(lat_loc,lon_loc,...
['(',num2str(lat_loc),'\circ N, ',num2str(lat_loc),'\circ S)'],...
'vert','middle','horiz','center');
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!