How to create a chloropleth map from a given raster array and Lat Lon meshgrid arrays?

2 views (last 30 days)
I have a raster array (R), a shapefile (District_Boundaries.zip), and lat lon meshgrid arrays (LatGrid.mat and LonGrid.mat). How to create a chloropleth map out of the mean for the given sub regions of the shapefile? I have attached all the files with this question.
The raster array is:
R=rand([604 584]);
Kindly help me with it.

Answers (1)

Shubham
Shubham on 20 Sep 2023
I understand that you want to plot a Choropleth map out of the dataset that you have provided.
I was not able to use readgeotable function for reading the shapefile as used in the documentation for plotting the chloropleth map. The dataset does not have geopolyshape present. However, the list of coordinates provided can be used to plot.
Please refer to the following code snippet:
% Read the shapefile
districts = shaperead('District_Boundaries.shp');
% Plot the districts
for i = 1:length(districts)
geoplot(districts(i).Y,districts(i).X,'-*')
hold on
end
The code produced the following output:
The subregions provided in the dataset are plotted as shown in the figure.
You may also try converting the shape into geopolyshape in the dataset.
Please refer to the following as well:
Hope this helps!!

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!