Borrar filtros
Borrar filtros

How to plot a box on an existing plot?

165 visualizaciones (últimos 30 días)
darkgod89
darkgod89 el 16 de Jun. de 2016
Comentada: Sim Mah el 14 de Feb. de 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.

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 16 de Jun. de 2016
Editada: Azzi Abdelmalek el 16 de Jun. de 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 comentario
Sim Mah
Sim Mah el 14 de Feb. de 2023
I think there is a typo. It should be:
rectangle('position',[xmin ymin xmax ymax])

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by