- 积分
 - 1110
 
	- 贡献
 -  
 
	- 精华
 
	- 在线时间
 -  小时
 
	- 注册时间
 - 2014-3-27
 
	- 最后登录
 - 1970-1-1
 
 
 
 
 
 
 | 
	
 
 
 楼主 |
发表于 2016-1-15 18:57:37
|
显示全部楼层
 
 
 
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"    
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"    
 
 
begin 
 
  data_num  = asciiread("/home/lhz/zone/zone1/num.txt",40,"float") 
 
  data1  = asciiread("/home/lhz/zone/zone1/zone1_h_rain_day-hazard_order.txt",(/40,2/),"float") 
  data2  = asciiread("/home/lhz/zone/zone1/zone1_final-hazard_order.txt",(/40,2/),"float") 
 
  x1    = data_num(:)  
  x2    = data_num(:)  
   
  y1    = data1(:,1) 
  y2    = data2(:,1)   
 
 
  wks = gsn_open_wks("png","gsn_csm_plot_x2y2")  
 
 
  res1                        = True  
 
  res1@gsnDraw                = False 
  res1@gsnFrame               = False 
  res1@gsnMaximize            = True 
 
  res1@vpXF                   = 0.20 
  res1@vpYF                   = 0.75 
  res1@vpHeightF              = 0.40          
  res1@vpWidthF               = 0.65 
 
 
  res1@tmXBMode               = "Explicit" 
  res1@tmXBValues             = ispan(1,40,2) 
  res1@tmXBLabels             = (/0.7, 6.0, 6.9, 7.1, 7.5, 7.6, 8.1, 8.2, 8.4, 8.7, 9.1, 9.3, 9.9, 10.2, 10.5, 10.8, 11.1, 11.8, 12.7, 14.8/) 
  res1@tmXBLabelFontHeightF   = 0.01 
  res1@tmXBMinorValues        = fspan(1,40,40)  
  res1@tmXBMinorOn            = True   
 
  res1@trYMaxF                = 5.4 
  res1@tmYRLabelsOn           = False 
 
  res1@xyLineThicknesses       = 5.0              
  res1@xyMarkLineModes         = "MarkLines"     
  res1@xyMarkers               = 16     
  res1@xyMarkerSizeF           = 0.006      
  res1@xyMarkerColors          = "black"                          
  res1@xyLineColors            = "black"        
 
  res1@tiXAxisString           = "rainfall_day" 
  res1@tiYAxisString           = "hazard_num" 
  res1@tiXAxisFontHeightF      = 0.015 
  res1@tiYAxisFontHeightF      = 0.015 
 
 
 
 
  res2                        = True   
 
  res2@gsnDraw                = False 
  res2@gsnFrame               = False 
  res2@gsnMaximize            = True 
 
  res2@tmXTMode               = "Explicit" 
  res2@tmXTValues             = ispan(1,40,4) 
  res2@tmXTLabels             = (/455.4, 768.1, 834.7, 878.5, 921.4, 966.0, 1007.2, 1089.2, 1175.9, 1307.8/) 
  res2@tmXTMinorOn            = True  
  res2@tmXTMinorValues        = fspan(1,40,40)  
  res2@tmXTLabelFontHeightF   = 0.01 
  res2@tiXAxisFontHeightF     = 0.015 
 
  res2@xyDashPatterns          = 1   
  res2@xyLineThicknesses       = 5.0              
  res2@xyMarkLineModes         = "MarkLines"     
  res2@xyMarkers               = 16       
  res2@xyMarkerSizeF           = 0.006      
  res2@xyMarkerColors          = "black"                          
  res2@xyLineColors            = "black"   
 
  res2@trYMaxF                = 5.4 
  res2@tmYRLabelsOn           = False 
 
 
  res2@tiXAxisString          = "annual_rainfall"   
  res2@tiMainFontHeightF      = 0.005 
 
 
  plot = gsn_csm_x2y2(wks,x1,x2,y1,y2,res1,res2) 
   
  draw(plot) 
  frame(wks) 
 
end |   
 
 
 
 |