Clear multiple layers from a plot

1 回表示 (過去 30 日間)
Ben
Ben 2015 年 11 月 18 日
I'm using bounding boxes plotted on top of text in an image as a sort of heat map. I want to be able to show all the bounding boxes for one condition, then clear them and show a different set. I read the post about getting the plot handle to clear the most recent one (<http://www.mathworks.com/matlabcentral/answers/1444-clear-one-plot-in-multiple-hold-figure#)>, but because the rectangle plotting function can only plot one box at a time, it doesn't seem feasible to clear all the boxes individually.
Example; the comment is what I'm trying to figure out how to do without just clearing everything including the background image:
imshow(I)
for i = 1:x
% Plot the bounding boxes
for j = 1:y
rectangle('Position', pos(i, :), 'EdgeColor', c(j, :));
end
% Clear the bounding boxes, but leave I
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