Can MATLAB do radial enlargements of plots?

1 回表示 (過去 30 日間)
Mariam Shahab
Mariam Shahab 2022 年 6 月 26 日
回答済み: DGM 2022 年 6 月 26 日
I have attached an image to illustrate what I mean. I will gladly appreciate any advice on this. Many thanks.

採用された回答

DGM
DGM 2022 年 6 月 26 日
You could do this by simply transforming the data itself
scale = 2;
center = [1 2]; % [x y]
r = 1;
th = 0:360;
x = r*cosd(th) + center(1);
y = r*sind(th) + center(2);
% transform data
x = (x - center(1))*scale + center(1);
y = (y - center(2))*scale + center(2);
hp1 = plot(x,y);
axis equal
grid on
... or you could do it by manipulating the graphics object directly
scale = 2;
center = [1 2]; % [x y]
r = 1;
th = 0:360;
x = r*cosd(th) + center(1);
y = r*sind(th) + center(2);
hp1 = plot(x,y);
axis equal
grid on
Ms = makehgtform('scale',scale);
Mtc = makehgtform('translate',[-center 0]);
t = hgtransform('parent',gca);
set(hp1,'parent',t)
set(t,'Matrix',Mtc*Ms)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by