Plotting a shapefile.

99 visualizzazioni (ultimi 30 giorni)
Suman Dhamala
Suman Dhamala il 19 Giu 2021
Risposto: Vimal Rathod il 23 Giu 2021
I want to plot shapefile. Shapefile is polygon. I used following code.
India=shaperead('india.shp');
longitude=ncread(filename,'lon');
latitude=ncread(filename,'lat');
mymap=pcolor(longitude,latitude,MeanJJASRain');
mymap.EdgeAlpha=0;
hold on
colorbar
caxis('auto');
title('Mean (1901-2018');
cmp=colormap;
cmp=flipud(cmp);
colormap(cmp);
mapshow(India);
hold off
Ignoring the rest, mapshow command plots the shapefile, but the shapefile is soild and filled inside. Because of this the plot from pcolor is hidden. How to make the shapefile transparent and plot only the outline?

Risposta accettata

Vimal Rathod
Vimal Rathod il 23 Giu 2021
Hi,
You could try using FaceAlpha property of mapshow to reduce the transparency of the polygons. Have a look at this example snippet.
% you can set the value of FaceAlpha from 0 to 1
% use FaceAlpha zero for total transparency
mapshow(india, 'FaceAlpha', 0)
Refer to the following link for more info on different properties of patches

Più risposte (0)

Categorie

Scopri di più su Lighting, Transparency, and Shading in Help Center e File Exchange

Prodotti


Release

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by