highlight plot with circle
Afficher commentaires plus anciens
I have a ber plot and I want to highlight this plot with a circle or any eliptical shape indicating (M×N).
2 commentaires
Awais Saeed
le 22 Août 2021
What do you mean by higlighting with circle. Do you mean like this

mudasir ahmad sheikh
le 22 Août 2021
Réponse acceptée
Plus de réponses (1)
Image Analyst
le 22 Août 2021
You can draw an ellipse if you know the center and radii:
xCenter = 12.5;
yCenter = 10;
xRadius = 2.5;
yRadius = 8;
theta = 0 : 0.01 : 2*pi;
x = xRadius * cos(theta) + xCenter;
y = yRadius * sin(theta) + yCenter;
plot(x, y, 'LineWidth', 3);
axis square;
xlim([0 20]);
ylim([0 20]);
grid on;
If you have an existing plot, call hold on before plotting the ellipse so it doesn't blow away your prior plotted data.
2 commentaires
mudasir ahmad sheikh
le 23 Août 2021
Image Analyst
le 23 Août 2021
@mudasir ahmad sheikh, you're welcome. Also I'm attaching a bunch of ellipse demos that you may find fun or interesting. You can "Vote" for my answer if they help you.
Catégories
En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
