【NCL】获取plot图经纬度的页面坐标-datatondc
2016-01-17 09:09
399 查看
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
infile = addfile("fnl_20101013_00_00_c.nc", "r")
var = infile->tmp(12,:,:)
; printVarSummary(var)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
wks = gsn_open_wks("x11","name")
res = True
res@gsnFrame = False
plot = gsn_csm_contour_map_ce(wks, var, res)
;
lons = (/120, -120/)
lats = (/10, -20/)
x_out = new(dimsizes(lons),float)
y_out = new(dimsizes(lats),float)
datatondc(plot,lons,lats,x_out,y_out)
; print(x_out)
; print(y_out)
;
txres = True
txres@txFontHeightF = 0.015
txres@txJust = "TopLeft"
gsn_text_ndc(wks,"Hello",x_out(0),y_out(0),txres)
gsn_text_ndc(wks,"World !",x_out(1),y_out(1),txres)
frame(wks)
end
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
infile = addfile("fnl_20101013_00_00_c.nc", "r")
var = infile->tmp(12,:,:)
; printVarSummary(var)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
wks = gsn_open_wks("x11","name")
res = True
res@gsnFrame = False
plot = gsn_csm_contour_map_ce(wks, var, res)
;
lons = (/120, -120/)
lats = (/10, -20/)
x_out = new(dimsizes(lons),float)
y_out = new(dimsizes(lats),float)
datatondc(plot,lons,lats,x_out,y_out)
; print(x_out)
; print(y_out)
;
txres = True
txres@txFontHeightF = 0.015
txres@txJust = "TopLeft"
gsn_text_ndc(wks,"Hello",x_out(0),y_out(0),txres)
gsn_text_ndc(wks,"World !",x_out(1),y_out(1),txres)
frame(wks)
end
相关文章推荐
- zend studio 10 字体,颜色,快捷键等相关设置
- day09-----------面向对象(传智视频)
- win10怎么这只让任务栏图标居中显示?
- 【NCL】复制变量的元数据(属性和坐标)-copy_VarMeta
- 解决ZendStudio打开utf-8格式的php文件乱码
- 分支语句的使用(比较大小)
- SQL高级查询
- mysql安装配置
- javascript实现倒计时跳转页面
- 【NCL】shea_util.ncl只能load一次
- 为什么使用指针比使用对象本身更好?
- BZOJ1059矩阵游戏
- php环境搭建
- eclipse+android环境搭建
- 无向连通图求割点和桥
- Android在浏览器启动APP
- 来吧
- 从框架到完整项目搭建,实战项目《约个球》(2)-框架搭建之使用CrashHandler来获取应用的Crash信息
- 【NCL】绘制河流的简易方法
- javascript实现的一个信息提示的小功能/