(mapping toolbox) Map axes xdata, ydata and zdata meaning?
3 次查看(过去 30 天)
显示 更早的评论
Hi,
I am using plot3m to plot the geographical location:
hplot = plot3m(lat,lon,h)
but to update the plot in the map it requires xdata, ydata, zdata
unfortunately there is not any documentation about the coordination of these fields in mapping toolbox?
how can I calculate xdata,ydata and zdata in the following code from lat,lon,h:
set(hplot,'xdata',xdata,'ydata',ydata,'zdata',zdata)
thanks in advance.
abblah
0 个评论
采纳的回答
Kelly Kearney
2019-9-5
编辑:Kelly Kearney
2019-9-5
Map axes apply a geographic transform to convert the geographic coordinates to the projection used by the map axis. You can perform this transform manually using mfwdtran:
ax = worldmap('world');
lat = [0 45];
lon = [0 45];
hln = plotm(lat, lon, '-ro');
% Compare the line's X/YData to manually transformed data
hln.XData
hln.YData
[x,y] = mfwdtran(lat, lon)
% The results you should see...
ans =
0 3.8059e+06
ans =
0 4.7997e+06
x =
0 3.8059e+06
y =
0 4.7997e+06
To go the opposite direction (i.e. convert from projected x/y to lat/lon, use minvtran).
更多回答(1 个)
dpb
2019-8-31
The map is still an axes underneath the hood so the internal property names are the same. But, the property name is just a name, the data are what are associated with the particular axis direction...just use
set(hplot,'xdata',lat,'ydata',lon,'zdata',h)
2 个评论
dpb
2019-9-4
I don't have mapping TB so can't do more than read the doc...
Did you use hold on before trying to add more to the existing plot?
Submit support request to Support if joy doesn't ensue...
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Object Properties 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!