How to plot a filled rectangle without edge?
Show older comments
'EdgeColor', 'None' makes the outline width to be zero?
Accepted Answer
More Answers (2)
Image Analyst
on 28 Sep 2015
0 votes
Set the edge color to the same color value as the "FaceColor'
Disregarding recent changes to options handling, this seems like it was always an adequately answerable question. It was just unclear what "filled rectangle" meant. I don't remember when dot notation started to be accepted here, but the same should have been practical using get()/set() in versions which might have been expected 10 years ago.
% use a rectangle object?
hr = rectangle('position',[1 1 15 10],'curvature',0.5);
hr.FaceColor = 'r';
hr.EdgeColor = 'none';
xlim([0 17])
ylim([0 12])
% use a patch object?
x = [1 1 16 16];
y = [1 11 11 1];
hp = patch(x,y,'r');
hp.EdgeColor = 'none';
xlim([0 17])
ylim([0 12])
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


