How to plot a box on an existing plot?

58 ビュー (過去 30 日間)
darkgod89
darkgod89 2016 年 6 月 16 日
コメント済み: Sim Mah 2023 年 2 月 14 日
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.

採用された回答

Azzi Abdelmalek
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
Sim Mah 2023 年 2 月 14 日
I think there is a typo. It should be:
rectangle('position',[xmin ymin xmax ymax])

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by