在MATLAB中使用"填充"功能时,如何更改边线颜色?

Ahm*_*mad 5 graphics matlab plot colors shapes

我正在编写代码,其中我使用MATLAB的fill命令绘制2D形状.我可以指定形状的填充颜色.但是,边框线颜色始终为黑色.我希望边框线颜色与填充颜色相同.我怎样才能指定边框线颜色?

sch*_*der 9

看到这个帖子:

To set the edgecolor to white do the following.

h = fill([-1 -1 1 1],[-1 1 1 -1],'w');
axis([-2 2 -2 2]);
set(h,'edgecolor','white');
Run Code Online (Sandbox Code Playgroud)

应该照顾边界.


gno*_*ice 8

除了schnaader的答案,您还可以在初始调用FILL时设置边缘颜色:

hPatch = fill(xData,yData,'r','EdgeColor','r');  %# Red patch with red edges
Run Code Online (Sandbox Code Playgroud)

或者完全阻止边缘被绘制:

hPatch = fill(xData,yData,'r','EdgeColor','none');  %# Red patch with no edges
Run Code Online (Sandbox Code Playgroud)