前几天正好做了一下极坐标的显示方面的东西,也做了一个差不多效果的图,帖上来看看,这是不是你要的效果?程序是有一些烦杂,还没有想到更简单的方法.
- t = linspace(0,2*pi,600);
- r = ones(1,length(t));
- hold on;polar(t,r);axis equal;
- Theta = [0:pi/6:pi,-pi:pi/6:0];
- for i = 1:length(Theta)-1
- if i <= 7
- str1 = '\pi/';
- str2 = num2str(i-1);
- str = strcat(str2,str1,'6');
- if i == 7
- x = cos(Theta(i));
- y = sin(Theta(i))+.1;
- text(x,y,str);
- else
- x = cos(Theta(i));
- y = sin(Theta(i));
- text(x,y,str);
- end
- else
- str1 = '\pi/';
- str2 = num2str(-i+8);
- str = strcat(str2,str1,'6');
- if i == 8
- x = cos(Theta(i));
- y = sin(Theta(i))-.1;
- text(x,y,str);
- else
- x = cos(Theta(i));
- y = sin(Theta(i));
- text(x,y,str);
- end
- end
- end
- axis off
复制代码 |