How to plot a box on an existing plot?
198 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Azzi Abdelmalek
2016-6-16
编辑:Azzi Abdelmalek
2016-6-16
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 个评论
Sim Mah
2023-2-14
I think there is a typo. It should be:
rectangle('position',[xmin ymin xmax ymax])
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!