How to change coordinates of the center of a radar plot?
3 次查看(过去 30 天)
显示 更早的评论
Hi all,
Im using the radarplot function. You can find the code for this function in the link below:
Using this function I get the following image:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1329955/image.png)
The center of this plot is at (0,0). I want to know if there is a way to change these coordinates using ginput . Any advice will be appreciated. Thanks.
0 个评论
回答(1 个)
Naren
2023-3-30
Hey Shahab,
I understand you are trying to change the centre of the plot using ginput. If an offset is given to the plot, it will just move the plot in some direction, and ginput just stores the point on the plot that is selected. To understand this, open the radarplot function and go through the following code.
R=[R R(:,1)];
[Theta,M]=meshgrid(2*pi/n*(0:n)+pi/n,ones(1,size(R,1)));
X=R.*sin(Theta);
Y=R.*cos(Theta);
A=plot(X',Y','LineWidth',2);
MAXAXIS=max(max(R))*1.1;
axis([-MAXAXIS MAXAXIS -MAXAXIS MAXAXIS]);
axis equal
axis off
To change the centre of the plot, the value of MAXAXIS has to be changed, which moves the plot.
Hope this solves your issue.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polar Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!