【发布时间】:2011-04-17 06:34:20
【问题描述】:
我正在编写代码,其中我使用 MATLAB 的 fill 命令来绘制 2D 形状。我可以指定形状的填充颜色。但是,边界线颜色始终为黑色。我希望边框线颜色与填充颜色相同。我如何还可以指定边框线颜色?
【问题讨论】:
标签: matlab graphics colors plot shapes
我正在编写代码,其中我使用 MATLAB 的 fill 命令来绘制 2D 形状。我可以指定形状的填充颜色。但是,边界线颜色始终为黑色。我希望边框线颜色与填充颜色相同。我如何还可以指定边框线颜色?
【问题讨论】:
标签: matlab graphics colors plot shapes
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');
应该注意边界。
【讨论】:
除了schnaader's answer,还可以在初始调用FILL时设置边缘颜色:
hPatch = fill(xData,yData,'r','EdgeColor','r'); %# Red patch with red edges
或者完全停止绘制边缘:
hPatch = fill(xData,yData,'r','EdgeColor','none'); %# Red patch with no edges
【讨论】: