I solved it by using the properties of axesm, Origin,FLatLimit, FLonLimit instead of MapLatLimit and MapLonLimit
How to fit axes to contourm plot?
3 ビュー (過去 30 日間)
Hello, I'm trying to create a map of mean wind speed in the region of Greece. My lat and lon are coming from the variables XLAT and XLONG respectively and the variable WS_mean contains the data I want to map. My code is:
axesm ('MapProjection', 'lambert', 'MapLatLimit', [min(min(double(XLAT))) max(max(double(XLAT)))],'MapLonLimit', [min(min(double(XLONG))) max(max(double(XLONG)))],'Frame','on','Grid','on', 'MeridianLabel', 'on', 'ParallelLabel', 'on');
geoshow ('landareas.shp','FaceColor','white', 'FaceAlpha',0,'Linewidth',2)
I'm attaching the resulting figure. As you can see the axes are not properly aligned with the result of the contourm. I've tried all of the MapProjections and none is fitting my needs. How do I fit the axes to the contourm plot? Or is something wrong with the way i'm depicting the data with the contourm command??
Thanks in advance
その他の回答 (2 件)
Muhammad Usman Saleem 2017 年 1 月 8 日
fix this in this manner
let me know after check?
Nithin Sivadas 2018 年 9 月 30 日
There is another way to fix this. Turns out that when one uses contourm(), sometimes the Cartesian axes limits change. I am assuming this is a bug. I found a solution to be to store the Cartesian limits before the contourm() and replace the buggy limits with it, after executing the function like this:
ax = gca; xlim = ax.XLim; ylim = ax.YLim;
ax.XLim = xlim; ax.YLim = ylim;