声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 3853|回复: 6

[绘图技巧] 极坐标画图rho如何变为负数

[复制链接]
发表于 2007-10-3 16:24 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
画一个方向图,rho全部为负数,假如最里圈为-80,最外圈为0,怎么能够画出?谢谢
回复
分享到:

使用道具 举报

发表于 2007-10-3 17:25 | 显示全部楼层

回复 #1 jojocleo 的帖子

polar绘图,如果向量长度为负则相当与方向相反,只改变角度。因此绘出来的图标注的长度都是正值

POLAR(THETA, -RHO)等价于POLAR(-THETA, RHO)

[ 本帖最后由 花如月 于 2007-10-3 17:35 编辑 ]

评分

1

查看全部评分

 楼主| 发表于 2007-10-3 21:14 | 显示全部楼层
那怎么解决呢?怎么能让显示的为负数呢?
发表于 2007-10-4 10:10 | 显示全部楼层



呵呵,支个笨招:先加上一个足够大的正数,然后将径向标注都手都减去这个正数.
发表于 2007-10-4 14:43 | 显示全部楼层

回复 #4 w89986581 的帖子

当然最简便的方式就是在图形窗口里修改下标注,如果需要程序修改会麻烦些。我对polar修改后存为mypolar,然后用它绘制r为负的极坐标图。其实极坐标里r正负同时出现几乎的情况是没有什么意义的,因为楼主需要负的坐标所以献丑了:lol
具体做法如下edit polar。在打开的m文件里找到这段
% draw radial circles
    c82 = cos(82*pi/180);
    s82 = sin(82*pi/180);
    rinc = (rmax-rmin)/rticks;
    for i=(rmin+rinc):rinc:rmax
        hhh = line(xunit*i,yunit*i,'linestyle',ls,'color',tc,'linewidth',1,...
                   'handlevisibility','off','parent',cax);
        text((i+rinc/20)*c82,(i+rinc/20)*s82, ...
            [' - ' num2str(i)],'verticalalignment','bottom',...
            'handlevisibility','off','parent',cax)%
这句就是用来标注半径的,在前边加个符号就可以了
    end
    set(hhh,'linestyle','-') % Make outer circle solid
然后另存为mypolar.m
在命令行测试如下:
>> r=1:5;tho=0:pi/2:2*pi;mypolar(tho,r)
>>
结果见附图

[ 本帖最后由 花如月 于 2007-10-4 14:52 编辑 ]
temp.jpg

评分

1

查看全部评分

发表于 2013-8-28 14:39 | 显示全部楼层
发表于 2013-8-30 00:13 | 显示全部楼层
極座標繪圖的相關技巧, 可參考
(From http://home.vibunion.com/blog-63979-18250.html)
4.Half polar coordinates figure plot function : halfPolar  http://www.mathworks.com/matlabc ... -function-halfpolar
   极坐标绘图 http://forum.vibunion.com/thread-93586-1-1.html
   极坐标坐标轴设置的问题 http://forum.vibunion.com/thread-74599-1-1.html
   极坐标画图rho如何变为负数 http://forum.vibunion.com/thread-52635-1-1.html
   matlab中极坐标系的控制 http://forum.vibunion.com/thread-31193-1-1.html
   怎么在极坐标中界定坐标的最大值 http://forum.vibunion.com/thread-90045-1-1.html
       polar2.m http://www.mathworks.com/matlabcentral/fileexchange/23589-polar-2
   3D Polar Plot http://www.mathworks.com/matlabc ... 13200-3d-polar-plot
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-18 12:09 , Processed in 0.061406 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表