Plotting shapefile data on top of surface data using Geoshow - how to create Zdata file?
이전 댓글 표시
I am trying to plot county boundaries on top of gridded precipitation data using geoshow with a surface plot. I can plot them independently, but the precipitation data plots on top of the county boundaries hiding the county lines. I can also make the desired plot with a textured map, but I would like to use a surface plot. I think this has to do with the Zdata, but I am not sure how to remedy this. I tried creating Zdata with values of 100 for the county boundaries to try to get them to plot on top of the precipitation data, but I get an error that the Array is the wrong shape and I am not sure how determine the correct shape array. This idea came from the below question. https://www.mathworks.com/matlabcentral/answers/20783-plotting-contours-from-a-shapefile-on-top-of-raster-data-which-were-plotted-using-surf
Is there a way to plot the county boundaries on top of a surface map of the gridded precipitation data using geoshow? If not, please advise on the best solution.
Thank you very much for your time.
Below is example code that I have been playing with.
x=data
R = georasterref('Latlim', [34.968 39.0313], 'Lonlim', [-121.0313 -113.9688], 'RasterSize', [66 114]);
geoshow(x,R, 'DisplayType','surface'); hold on
county = shaperead('tl_2012_us_county.shp',... 'UseGeoCoords', true, 'BoundingBox', [lonlim', latlim']);
%length(county.Lat) is 5793
%length(county.Lon) is 1700
Z(1:5792,1:1700)=100; %I also tried Z'
geoshow([county.Lat],[county.Lon],Z)%,'Color','black')
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Geographic Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!