How to clear this plot?
显示 更早的评论
As shown in the picture, what about the ellipse in the lower left corner?
My code wants to express that the size of the two ellipses can be changed by myself.
I want to present an ellipse and a regular circle.

xUECenter=5;
yUECenter=5;
a = 3;
b = 3;
r = a;
hEllipse = imellipse(gca,[-a, -b, 2*a, 2*b]);
disp(hEllipse);
xy = hEllipse.getVertices();
axesHandlesToChildObjects = findobj(gca, 'Type', 'line');
if ~isempty(axesHandlesToChildObjects)
delete(axesHandlesToChildObjects);
end
x = xy(:,1);
y = xy(:,2);
xy = [x y];
for k = 1 : length(angles_Panel_0)
theta = angles_Panel_0(k);
rotationArray = [cosd(theta) sind(theta); -sind(theta) cosd(theta)];
rotated_xy = xy * rotationArray;
xCenter2 = xUECenter + (r - 0.25) * cosd(theta);
yCenter2 = yUECenter + (r - 0.25) * sind(theta);
x = rotated_xy(:,1) + xCenter2;
y = rotated_xy(:,2) + yCenter2;
plot(x, y, 'b');
if k == 1
grid on;
hold on;
end
end
hold on;
xNodeCenter=6;
yNodeCenter=6;
a = 3;
b = 0.5;
r = a;
hEllipse1 = imellipse(gca,[-a, -b, 2*a, 2*b]);
xy = hEllipse1.getVertices();
axesHandlesToChildObjects = findobj(gca, 'Type', 'line');
x = xy(:,1);
y = xy(:,2);
xy = [x y];
for k = 1 : length(angles)
theta = angles(k);
rotationArray = [cosd(theta) sind(theta); -sind(theta) cosd(theta)];
rotated_xy = xy1 * rotationArray;
xCenter3 = xNodeCenter + (r - 0.25) * cosd(theta);
yCenter3 = yNodeCenter + (r - 0.25) * sind(theta);
x1 = rotated_xy(:,1) + xCenter3;
y1 = rotated_xy(:,2) + yCenter3;
plot(x1, y1, 'm');
if k == 1
grid on;
hold on;
end
end
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!