爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 6913|回复: 0

[作图] 变量维度不匹配,这是什么原因?感觉设置的没问题

[复制链接]
发表于 2019-9-18 16:18:14 | 显示全部楼层 |阅读模式

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

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

x
;----------------------------------------------------------------------
; contoursym_1.ncl
;
; Concepts illustrated:
;   - Using a symmetric color map
;   - Using a blue-red color map
;   - Explicitly setting contour levels
;----------------------------------------------------------------------
;
; These files are loaded by default in NCL V6.2.0 and newer
; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"   
; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"  

begin
;---Open file and read in Sea Surface Temperature Anomalies
  a   = addfile("sst.nc","r")
  sst = a->sst
lon1 = a->longitude
lat1 = a->latitude


dim1=dimsizes(sst)
ave1=new((/dim1(0),dim1(1)/),"float")
ave1=0
copy_VarCoords(sst(:,:,1),ave1)
ave1!0 = "lon"
ave1!1 = "lat"
ave1&lon=lon1
ave1&lat=lat1
lat@units = "degrees_north"
lon@units = "degrees_east"
;---Start the graphics
  wks = gsn_open_wks("png","contoursym")         ; send graphics to PNG file

  res                      = True

  res@gsnMaximize          = True               ; maximize plot in frame

  res@cnLevelSelectionMode = "ManualLevels"     ; set manual contour levels
  res@cnMinLevelValF       = 0.                ; set min contour level
  res@cnMaxLevelValF       = 30.                ; set max contour level
  res@cnLevelSpacingF      =  0.5               ; set contour spacing

  res@cnFillOn             = True               ; turn on contour fill
  res@cnLinesOn            = False              ; turn off contour lines
  res@cnLineLabelsOn       = False              ; turn off contour labels

  res@cnFillPalette        = "BlueRed"          ; set color map

  plot = gsn_csm_contour_map(wks,ave1,res)
end


QQ截图20190918161727.png
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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