use Plot instead of rectangle
1 回表示 (過去 30 日間)
古いコメントを表示
How can i use plots instead of rectangle function for plotting?
0 件のコメント
回答 (1 件)
DGM
2022 年 10 月 31 日
編集済み: DGM
2022 年 10 月 31 日
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
plot(x,y)
If you intend to replicate other functionality of rectangle(), that will be more complicated.
1 件のコメント
DGM
2022 年 10 月 31 日
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.
参考
カテゴリ
Help Center および File Exchange で Line Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!