爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 2771|回复: 2

[求助] 仍然是自定义圆点画站点分布图。。。这只是个例子

[复制链接]

新浪微博达人勋

发表于 2015-3-12 11:01:37 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
这个程序运行不出来,麻烦大神看看错在哪儿了?
function circle,xcenter,ycenter,radius
points=(2*!pi/99.0)*findgen(100)
x=xcenter+radius*cos(points)
y=ycenter+radius*sin(points)
;UserSym x, y, /Fill
return,transpose([x],[y])
end
pro circle
seed = -3L
x = RandomU(-3L,30)
y = RandomU(-3L,30)
z =(3*((x-0.5)^2) + 5*((y-0.25)^2))*1000
Window, Xsize=400, Ysize=350 ,color=5
Plot, x, y, Psym=4, Position=[0.15, 0.15, 0.75, 0.95],Xtitle='X Locations', Ytitle='Y Locations'
LoadCT, 2
zcolors = Bytscl(z, Top=!D.Table_Size-1)
coords = Convert_Coord (x, y, /Data, /To_Device)
x = coords(0,*) & y = coords(1,*)
For j=0,  29  Do  Polyfill, Circle(x(j),y(j),10),/Fill,Color=zcolors(j),/Device
Colorbar, Position = [0.85, 0.15, 0.90, 0.95],Range=[Min(z), Max(z)], /Vertical,Format='(I5)', /Right, Title='Z Values'
end
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2015-3-12 11:25:06 | 显示全部楼层
transpose用法不对。简单改了一下,没有仔细考虑,仅供参考!

pro circle2,xcenter,ycenter,radius, x, y
points=(2*!pi/99.0)*findgen(100)
x=xcenter+radius*cos(points)
y=ycenter+radius*sin(points)
;UserSym x, y, /Fill
;return,transpose([x],[y])
end
pro circle
    seed = -3L
    x = RandomU(-3L,30)
    y = RandomU(-3L,30)
    z =(3*((x-0.5)^2) + 5*((y-0.25)^2))*1000
    Window, Xsize=400, Ysize=350 ,color=5
    Plot, x, y, Psym=4, Position=[0.15, 0.15, 0.75, 0.95],Xtitle='X Locations', Ytitle='Y Locations'
    LoadCT, 2
    zcolors = Bytscl(z, Top=!D.Table_Size-1)
    coords = Convert_Coord (x, y, /Data, /To_Device)
    x = coords(0,*) & y = coords(1,*)
    For j=0,  29  Do  begin
          Circle2, x(j), y(j),10, xout, yout
          Polyfill, xout, yout,/Fill,Color=zcolors(j),/Device
    Endfor
    ;Colorbar, Position = [0.85, 0.15, 0.90, 0.95],Range=[Min(z), Max(z)], /Vertical,Format='(I5)', /Right, Title='Z Values'
end


无标题.png



密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2015-3-12 14:43:26 | 显示全部楼层
longlivehj 发表于 2015-3-12 11:25
transpose用法不对。简单改了一下,没有仔细考虑,仅供参考!

pro circle2,xcenter,ycenter,radius, x,  ...

嗯哪,谢谢你。。。
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

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