- 积分
- 3544
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-9-29
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
请问如何关闭坐标轴啊?我已经使用了mpres@pmTickMarkDisplayMode="Never" 但是没有效果
程序如下:
load "$WORKDIR/include/library.ncl"
undef ("setProperty")
procedure setProperty(olon, olat)
begin
olon!0 = "lon"
olon@long_name = "lon"
olon@units = "degrees-east"
olon&lon = olon
olat!0 = "lat"
olat@long_name = "lat"
olat@units = "degrees_north"
olat&lat = olat
end
;数据赋坐标
undef ("setCoordinate")
procedure setCoordinate(data,lon,lat)
begin
data!0 = "lat"
data&lat = lat1
data!1 = "lon"
data&lon = lon1
end
begin
system("date")
configFile="$WORKDIR/config/h8sat.config"
;读取命令行参数字符串数组
inputfileName = getArgsPara(params,"inputfileName")
;=================================================读取配置文件=====================================
x0 = stringtofloat(readParamInfo(configFile,"X0"))
x1 = stringtofloat(readParamInfo(configFile,"X1"))
y0 = stringtofloat(readParamInfo(configFile,"Y0"))
y1 = stringtofloat(readParamInfo(configFile,"Y1")) ;A reference longitude and latitude
;图片大小
imgWidth=stringtointeger(readParamInfo(configFile,"IMGWIDTH"))
imgHeight=stringtointeger(readParamInfo(configFile,"IMGHEIGHT"))
;早晚时间配置
dayHour=stringtointeger(readParamInfo(configFile,"DAYHOUR"))
nightHour=stringtointeger(readParamInfo(configFile,"NIGHTHOUR"))
arr=(/333,666,9999/)
narr=dimsizes(arr)
;diri = "/home/zx/test/"
;params = systemfunc ("ls "+ diri + "HS_H08_20160801_0850_B14_TURB_R20.txt")
data = asciiread(inputfileName, (/2066,3/), "float")
data@_FillValue=-9999
IRnums=dimsizes(data)
lon = data(4:2065,1)
lat = data(4:2065,2)
setProperty(lon, lat)
lat_new=new((/narr+1,dimsizes(lat)/), float)
lon_new=new((/narr+1,dimsizes(lon)/), float)
height = data(4:2065,0)
;print (height)
do i=0,narr
if (i.eq.0) then
indexes=ind(height.lt.arr(0))
end if
if (i.eq.narr) then
indexes=ind(height.ge.arr(2))
end if
if (i.gt.0.and.i.lt.narr) then
indexes=ind(height.ge.arr(i-1).and.height.lt.arr(i))
end if
if(all(ismissing(indexes))) then
delete(indexes)
continue
end if
npts_range=dimsizes(indexes)
;print (indexes)
lat_new(i,0:npts_range-1)=lat(indexes)
lon_new(i,0:npts_range-1)=lon(indexes)
delete(indexes)
end do
;==================begin plot==================================
filePart=str_split(inputfileName,"/")
fileName=filePart(dimsizes(filePart)-1)
splitName=str_split(fileName,".")
splitPart=str_split(splitName(0),"_")
strtime=splitPart(2) ;日期
strhour=str_get_cols(splitPart(3),0,1) ;时间
strmin=str_get_cols(splitPart(3),2,3)
outputPath="$PRODUCTDIR"+"/"+strtime+"/Turbu"
checkOrCreateDir(outputPath)
outputfileName=str_sub_str(splitName(0),splitPart(4),"Turbu")+"_NJ"
wks=gsn_open_wks("png",outputPath+"/"+outputfileName)
mpres=True
mpres@vpXF = 0.0
mpres@vpYF = 1.0
; 调节矩形的长宽
mpres@vpWidthF = 1.0
mpres@vpHeightF = 1.0
mpres@gsnFrame=False
mpres@gsnDraw=False
mpres@mpMinLatF=min(lat)
mpres@mpMaxLatF=max(lat)
mpres@mpMinLonF=min(lon)
mpres@mpMaxLonF=max(lon)
;mpres@tmXBLabelFontHeightF=0.012
;mpres@tmYLLabelFontHeightF=0.012
mpres@pmTickMarkDisplayMode="Never"
mpres@mpFillOn = False
mpres@mpOutlineOn = False
;mpres@mpFillColors = "background"
map=gsn_csm_map(wks, mpres)
gsres=True
gsres@sfXArray=lon
gsres@sfYArray=lat
gsres@cnRasterSmoothingOn = True
gsres@cnSmoothingDistanceF =True
gsres@cnSmoothingOn=True
gsres@cnSmoothingTensionF=True
gsres@gsMarkerIndex=NhlNewMarker(wks, "y", 35, 0.0, 0.0, 1.0, 0.2, 0.0)
colors = (/(/255,255,255/),(/0,0,0/),(/0,0,0/),(/0,0,0/)/)*1.0
cmap = colors/255.
gsn_define_colormap(wks,cmap)
getvalues wks
"wkColorMapLen":clen
end getvalues
nstep=(clen-2)/narr
colorss=ispan(2, 5, 1)
do j=0,narr
gsres@gsMarkerColor=colorss(j)
dumstr=unique_string("marker")
map@$dumstr$=gsn_add_polymarker(wks, map, lon_new(j,:), lat_new(j,:), gsres)
end do
draw(map)
frame(wks)
cmd="convert -transparent white "+outputPath+"/"+outputfileName+".png"+" "+outputPath+"/"+outputfileName+"_T.png"
system(cmd)
end
|
-
如图
|