爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 6638|回复: 4

ncl作图颜色问题

[复制链接]

新浪微博达人勋

发表于 2017-5-31 23:19:16 | 显示全部楼层 |阅读模式

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

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

x
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
;-- read the data and define
  fili = "MITgcm_rectilinear_grid_3D.nc"
  
  
  file1 =  addfile(fili,"r")
  var   =  file1->SSS(0,0,:,:)
;-- define the workstation (plot type and name)
  wks = gsn_open_wks("x11","NUG_projections_mollweide")
;-- set resources
  res                       =  True
  res@gsnMaximize           =  True
  res@lbLabelStride         =  2               ;-- label every other box
  res@lbBoxMinorExtentF     =  0.15            ;-- decrease the height of the labelbar
  res@cnFillOn              =  True            ;-- turn ofncontour fill
  res@cnFillPalette         = "BlueWhiteOrangeRed" ;--change color map
  res@cnLinesOn             =  False           ;-- turn off contour lines
  res@cnLineLabelsOn        =  False           ;-- turn off line labels
  res@cnLevelSelectionMode  = "ManualLevels"   ;-- set contour levels manually
  res@cnMinLevelValF        =   0.             ;-- minimum contour level
  res@cnMaxLevelValF        =  42.             ;-- maximum contour level
  res@cnLevelSpacingF       =   2               ;-- contour level spacing
  res@mpProjection          = "Mollweide"      ;-- change projection
  res@mpGridAndLimbOn       =  True             ;-- plot grid lines
  res@tiMainString          = "NCL Doc Example: Mollweide projection"   ;-- title string
  res@tiMainFontHeightF     =  0.02
;-- draw the contour map
  plot = gsn_csm_contour_map(wks, var, res)
end

以上是作图的脚本,来自官网,设置的颜色在图上体现不出来,
希望知道的朋友们可以帮我解答一下,谢谢你!

这个图是该脚本应该出来的图

这个图是该脚本应该出来的图

这个图是我运行出来的

这个图是我运行出来的

这个是运行脚本所报的错

这个是运行脚本所报的错
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 成长值: 0
发表于 2017-6-1 15:50:55 | 显示全部楼层
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 成长值: 0
发表于 2017-6-1 15:51:09 | 显示全部楼层
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-6-1 23:41:17 | 显示全部楼层
谢谢你,小的明白了,正在努力解答自己的问题,只是还没有真正解决,
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2017-6-2 05:02:56 | 显示全部楼层
是不是先把海洋设置成white,陆地设置成grey,然后再绘制你的数据。
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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