How to plot a box on an existing plot?
159 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
darkgod89
il 16 Giu 2016
Commentato: Sim Mah
il 14 Feb 2023
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 Commenti
Risposta accettata
Azzi Abdelmalek
il 16 Giu 2016
Modificato: Azzi Abdelmalek
il 16 Giu 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 Commento
Sim Mah
il 14 Feb 2023
I think there is a typo. It should be:
rectangle('position',[xmin ymin xmax ymax])
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Line Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!