Is there an equivalent for contourc in the mapping toolbox?

1 Ansicht (letzte 30 Tage)
Alexander
Alexander am 24 Jul. 2015
Beantwortet: Chad Greene am 1 Aug. 2015
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

Akzeptierte Antwort

Chad Greene
Chad Greene am 1 Aug. 2015
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);

Weitere Antworten (0)

Kategorien

Mehr zu Lighting, Transparency, and Shading finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by