views:

57

answers:

2

I'm writing code in which I use MATLAB's fill command to plot 2D shapes. I can specify the fill color of the shape. However, the border line color is always black. I want the border line color the same as the fill color. How can I also specify the border line color?

+3  A: 

See this thread:

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');

that should take care of the border.
schnaader
+2  A: 

In addition to schnaader's answer, you can also set the edge color in the initial call to FILL:

hPatch = fill(xData,yData,'r','EdgeColor','r');  %# Red patch with red edges

Or stop the edges from being drawn altogether:

hPatch = fill(xData,yData,'r','EdgeColor','none');  %# Red patch with no edges
gnovice