How to plot a box on an existing plot?
163 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I know it is possible to use the rectangle option but that requires you to specify [x y width height]. I want to plot a box with [xmin xmax ymin ymax] or similar as I don't know the width and height and only the coordinates.
0 commentaires
Réponse acceptée
Azzi Abdelmalek
le 16 Juin 2016
Modifié(e) : Azzi Abdelmalek
le 16 Juin 2016
xmin=0;
xmax=1;
ymin=0;
ymax=1;
plot([xmin xmax xmax xmin xmin],[ymin ymin ymax ymax ymin])
or
rectangle('position',[xmin ymin xmin xmax])
1 commentaire
Sim Mah
le 14 Fév 2023
I think there is a typo. It should be:
rectangle('position',[xmin ymin xmax ymax])
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Line 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!