Borrar filtros
Borrar filtros

use Plot instead of rectangle

1 visualización (últimos 30 días)
PA el 31 de Oct. de 2022
Comentada: DGM el 31 de Oct. de 2022
How can i use plots instead of rectangle function for plotting?

Respuestas (1)

DGM el 31 de Oct. de 2022
Editada: DGM el 31 de Oct. de 2022
Given the same position vector that would be used for rectangle():
% the position parameter used by rectangle()
pos = [0 0 20 10]; % [x y w h]
% rearrange to create a point list
x = pos(1) + pos(3)*[0 1 1 0 0];
y = pos(2) + pos(4)*[0 0 1 1 0];
% plot it
If you intend to replicate other functionality of rectangle(), that will be more complicated.
  1 comentario
DGM el 31 de Oct. de 2022
You have some offset in your position data. That's not something I can know from this information. Look at whatever calculations you're using to caclulate the center positions of the holes. Work backwards from there.

Iniciar sesión para comentar.


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


Community Treasure Hunt

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

Start Hunting!

Translated by