Clear Filters
Clear Filters

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

3 views (last 30 days)
I have a raster array (R), a shapefile (, 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 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)
hold on
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!!




Community Treasure Hunt

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

Start Hunting!