Effacer les filtres
Effacer les filtres

How can I selectively hold on and hold off plots in a polar plot

25 vues (au cours des 30 derniers jours)
Vinod
Vinod le 13 Jan 2015
I have a for loop like this:
figure;
for i = 1:100
p1 = polar(thetaOne(i),rOne(i),'r+')
% *hold on* the above plot
p2 = polar(thetaTwo(i),rTwo(i),'g+')
% *hold off* the above plot
end
I have to retain the p1 and remove p2 from every iteration.
Suppose at i == 50, all the values thetaOne(1:50),rOne(1:50) must be there in the figure, and only thetaTwo(50),rTwo(50) must be present in the figure.

Réponse acceptée

David Sanchez
David Sanchez le 13 Jan 2015
Then, you have to do this:
figure;
for i = 1:100
for k=1:i
p1 = polar(thetaOne(k),rOne(k),'r+')
hold on
end
p2 = polar(thetaTwo(i),rTwo(i),'g+')
hold off
end

Plus de réponses (1)

Stephen23
Stephen23 le 13 Jan 2015
Modifié(e) : Stephen23 le 13 Jan 2015
If you read the documentation for hold you will find that the following syntaxes are permitted:
hold one
hold off
hold all
hold
hold(ax,'on')
hold(ax,'off')
hold(ax)
So you can supply the axes handle (using the function form), and it will control only that axis.

Catégories

En savoir plus sur Polar Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by