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?
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With