필터 지우기
필터 지우기

How to plot a box on an existing plot?

조회 수: 159 (최근 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 CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by