Is there an equivalent for contourc in the mapping toolbox?

2 ビュー (過去 30 日間)
Alexander
Alexander 2015 年 7 月 24 日
回答済み: Chad Greene 2015 年 8 月 1 日
I have two georeferenced 2D fields (lat,lon,F1,F2). I want to plot them into the same axis, one of them with
axesm('MapProjection','stereo', ...)
pcolorm(lat,lon,F1)
and from the other one only a single contourline with
contourm(lat,lon,F2,[2 2]).
Of course this doesn't work since both fields have different physical meanings/units.
In a X/Y coordinate system I could use the low level function contourc (without plot)
C = contourc(x,y,F2)
with gives me the x/y coordinates of the contour lines. So I would be able to plot the contourlines into the same axis with the line function.
However, there is no function contourcm .
I could plot F2 in a second figure using
C = contourm(lat,lon,pv',[2 2];
to get the coordinates (lat/lon) of the contourline and then plot this line using linem.
Is it somehow possible to plot both fields into one axis in the way described above, and avoid a second (contourline) plot?
Thanks

採用された回答

Chad Greene
Chad Greene 2015 年 8 月 1 日
I have a similar response to the one I gave to a different question you recently asked. If you convert your georeferenced coordinates to map coordinates you can usually use regular plotting (not mapping) functions. After you've initialized a map with
axesm('MapProjection','stereo', ...)
You should be able to convert any lat,lon data to map coordinates, which are usually an x,y grid in the range of -0.5 to 0.5 or something thereabouts. With a map initialized,
[x,y] = mfwdtran(lat,lon);
converts your lat,lon data to projected x,y data based on the current map's projection formula. With x and y data, you can then plot it with any standard plotting functions like plot, contourc, etc.
C = contourc(x,y,F2);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by