Erase many layers of a plot, leave the background

1 回表示 (過去 30 日間)
Ben
Ben 2015 年 11 月 18 日
I use the rectangle function to draw colored bounding boxes on top of an image containing text. I would like to be able to remove the bounding boxes and draw new ones without having to recreate the entire plot. Is there a way to do that? I saw a post about doing this with a single layer (<http://www.mathworks.com/matlabcentral/answers/1444-clear-one-plot-in-multiple-hold-figure)>, but that doesn't seem scalable to many layers.
Example code:
imshow(I);
c = colormap(jet);
for i = 1:x
% Plot the bounding boxes
for j = 1:y
rectangle('Position', pos, 'EdgeColor', c(j, :));
end
% Clear boxes, leave background image
end

回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by