Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
多边形mapshow MatLab中的边界颜色_Matlab_Colors_Maps_Polygon_Matlab Figure - Fatal编程技术网

多边形mapshow MatLab中的边界颜色

多边形mapshow MatLab中的边界颜色,matlab,colors,maps,polygon,matlab-figure,Matlab,Colors,Maps,Polygon,Matlab Figure,如何在MatLab中更改choropleth贴图中多边形边界的颜色?(同时保持多边形内的颜色)。可复制代码如下 MapLatLimit = [41 48]; MapLonLimit = [-74 -66]; NEstates = shaperead('usastatelo', 'UseGeoCoords', true, 'BoundingBox', [MapLonLimit' MapLatLimit']); datawithNaN = [30 20 30 NaN 40 50 NaN

如何在MatLab中更改choropleth贴图中多边形边界的颜色?(同时保持多边形内的颜色)。可复制代码如下

      MapLatLimit = [41 48];
MapLonLimit = [-74 -66];

NEstates = shaperead('usastatelo', 'UseGeoCoords', true, 'BoundingBox', [MapLonLimit' MapLatLimit']);
datawithNaN = [30 20 30 NaN 40 50 NaN NaN];
% Here replace NaNs with a number (treat as category):
datawithNaN(isnan(datawithNaN)) = 0;
datawithNaN = num2cell(datawithNaN);

% Here I create a color map, using white for NaN (category = 0);
mycolormap = [  1 1 1;...
               .4 .1 .9;...
               .3 .2 .8;...
               .2 .3 .7;...
               .1 .4 .6];
[NEstates.datawithNaN] =  deal(datawithNaN{:});
densityColors = makesymbolspec('Polygon', {'datawithNaN',   [0 50], 'FaceColor', mycolormap});
mapshow(NEstates, 'DisplayType', 'polygon',  'SymbolSpec', densityColors)

通过添加属性“EdgeColor”,可以将颜色更改为任何颜色。在下面的示例中,我选择了红色,
r
。有关更多颜色选项:。颜色也可以定义为阵列形式的RGB三重矩阵
[r g b]

在哪里,

r
→ 红色强度范围为0到1
g
→ 绿色强度范围为0到1
b
→ 蓝色强度范围为0到1

densityColors = makesymbolspec('Polygon', {'datawithNaN',   [0 50], 'FaceColor', mycolormap,'EdgeColor','r'});

非常感谢@MichaelTr7,我想象这是一件简单的事情,但我无法找到在属性中添加更改的位置/方式。再次感谢!没问题,很乐意帮忙。