爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 7771|回复: 4

[作图] 问题求助: 手动设置多图位置,坐标仅仅显示在左侧和底部, 重影?

[复制链接]

新浪微博达人勋

发表于 2015-11-4 09:43:10 | 显示全部楼层 |阅读模式

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

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

x
问题求助:
首先非常感谢您宝贵的时间,

问题描述: ncl自己画的面板图,每个图都有经纬坐标,为了尽可能的放大图像的显示面积,想仅仅把图的左侧和底部坐标显示,其他公用坐标,暂时是自己手动调整每幅图出现的位置,但是遇到坐标轴重影问题? 一直搞不定,特把图和画图设置的脚本贴出来,求大神给支个招?  

再次感谢    ~ ~

图 如下

lag_iod_tauxy_ssta_页面_1.jpg


脚本如下

;************************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/skewt_func.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/wind_rose.ncl"
;-------------------------------------------------
; There are four region based indices used to monitor the tropical Pacific:
; Nino 1+2 (0-10S, 90W-80W), Nino 3 (5N-5S, 150W-90W),
; Nino 3.4/ONI (5N-5S, 170W-120W) and Nino 4 (5N-5S, 160E-150W)
;-------------------------------------------------
;************************************************
begin
;*************  set up  some parameter        *********   
  lonL   = 35
  lonR   = 115
  latB   = -30
  latT   = 25

  yrStrt = 1982
  yrLast = 2013


;************  open files and  read the data ***********  
;~~~~~  get the sst and some parameter  ~~~~~~~~~~~
  file_sst = systemfunc("ls /home/gfy/data/NCEP_DOE_Reanalysis2_Summary_daliy/necp_daliy_sst/*nc")
  f_sst    = addfiles(file_sst, "r")
  ListSetType (f_sst,"cat")
  ssts     = f_sst[:]->sst(:,{latB:latT},{lonL:lonR})
  sst      = short2flt(ssts)
  copy_VarCoords(ssts,sst)
  printVarSummary(sst)
  delete(ssts)

balabablabal
。。。。。。
。。。。。。


;================================================
  gtest    = (/ugtval/)
  gtest    = (/test/)
;  ugrc     = where(abs(ugtval).lt.gtest,ugrc@_FillValue,ugrc)
;  vgrc     = where(abs(vgtval).lt.gtest,vgrc@_FillValue,vgrc)
  ugrc     = where(abs(ugtval).lt.gtest.and.abs(vgtval).lt.gtest,ugrc@_FillValue,ugrc)
  vgrc     = where(abs(ugtval).lt.gtest.and.abs(vgtval).lt.gtest,vgrc@_FillValue,vgrc)

  tgrc     = where(abs(tgtval).lt.gtest,tgrc@_FillValue,tgrc)
; 注:tgrc,ugrc,vgrc 等(lat,lon,49)这么大小的数据
  
;************************************************
; create plot
;************************************************
  wks = gsn_open_wks("pdf" ,"lag_iod_tauxy_ssta")                ; open a ps file
  gsn_define_colormap(wks,"BlWhRe")              ; choose colormap
;  gsn_define_colormap(wks,"BlAqGrYeOrRe")        ; choose colormap
  maxlag = 24
  nplot = maxlag*2+1
  plot = new(nplot,graphic)                          ; create a plot array

  res                       = True     ; plot mods desired
  resV                      = True

  res@gsnDraw              = False              ; don't draw
  res@gsnFrame             = False              ; don't advance frame

  resV = res

  res@gsnRightString   = ""
;  res@gsnLeftString    = "Regression  u v at 850hpa"
  res@gsnLeftString    = ""
  res@gsnCenterString  = ""

  res@cnFillOn              = True     ; turn on color fill
  res@cnLinesOn             = False    ; turn of contour lines
  res@cnLevelSelectionMode = "ManualLevels"      ; manually set cn levels
  res@cnMinLevelValF       =  -0.5                 ; min level
  res@cnMaxLevelValF       =    .5                 ; max level
  res@cnLevelSpacingF      =   .1                  ; contour level spacing
;  res@cnLevelSpacingF       = 0.5      ; contour spacing

;---This resource not needed in NCL V6.1.0
  res@gsnSpreadColors       = True     ; use full range of color map

  res@lbLabelBarOn          = False

  res@lbLabelStride         = 4

  res@pmTickMarkDisplayMode = "Always"; use NCL default lat/lon labels
  res@mpFillOn = True
  res@gsnAddCyclic =       False
  res@mpCenterLonF =       180
  res@mpMaxLatF = latT                         ; specify the plot domain
  res@mpMinLatF = latB                         ;
  res@mpMinLonF = lonL                        ;
  res@mpMaxLonF = lonR                        ;
;  res@mpFillDrawOrder  = "PostDraw"
  res@mpFillDrawOrder  = "PreDraw"

  res@tmXBLabelFontHeightF   = 0.020
  res@tmYLLabelFontHeightF   = 0.020

;------
  res@tmXBLabelsOn           = False
  res@tmXBOn                 = False
  res@tmXTLabelsOn           = False
  res@tmXTOn                 = False
  
  res@tmYRLabelsOn           = False
  res@tmYROn                 = False
  res@tmYLLabelsOn           = False
  res@tmYLOn                 = False



;*******************  vector ***********
  resV@vcRefMagnitudeF  = .01                        ; add a reference vector
  resV@vcRefLengthF     = 0.045                     ; what the ref length is
  resV@vcGlyphStyle     = "CurlyVector"             ; turn on curley vectors

; resV@vcRefAnnoOn      = False
;  resV@pmLabelBarDisplayMode    = "Always"          ; Turn on a label bar.
;  resV@pmLabelBarWidthF         = 0.08              ; make it thinner
;  resV@lbPerimOn                = False             ; no box around it

  resV@vcRefAnnoParallelPosF    = 0.98   ; 0.02
  resV@vcRefAnnoOrthogonalPosF  = 0.02   ; 1.0
  resV@vcRefAnnoPerimOn         = False
  resV@vcRefAnnoString2On       = False
  resV@vcFillArrowWidthF        = 0.02

;=============
;图片的位置 信息
    res@vpWidthF  =  0.24
    res@vpHeightF = 0.19
    xp     = (/0.15,0.4,0.65/)
    yp     = (/0.9,0.7,0.5,0.3/)
    gxp    = conform_dims((/4,3/), xp,1 )
    gyp    = conform_dims((/4,3/), yp,0 )
    fxp    = reshape(gxp,12)
    fyp    = reshape(gyp,12)



;***************************************
  test  = 1.96
  do it = 0,nplot-1,3        ; 5,16
    inum  = (it-maxlag)
    ip    = it/3

;===========
    if(ip.eq.11)then
    res@lbLabelBarOn              = True
    res@lbLabelFont               = 25
    res@pmLabelBarParallelPosF    = -0.5
    res@pmLabelBarOrthogonalPosF  = 0.2
    res@pmLabelBarHeightF         = 0.1
    res@pmLabelBarWidthF          = 0.4
    res@lbLabelFontHeightF        = 0.02
    res@lbLabelStride             = 5
    end if

    if(ip.le.11)then
    res@gsnCenterString            = inum+" Pentad"
    res@gsnCenterStringFontHeightF = .02
    res@vpXF = fxp(ip)
    res@vpYF = fyp(ip)

;===========
    plot11 = gsn_csm_contour_map_ce(wks,tgrc(:,:,it), res)
    plot12 = gsn_csm_vector(wks,ugrc(::2,::2,it),vgrc(::2,::2,it),resV)
    overlay(plot11,plot12)

    if(inum.eq.-24.or.inum.eq.-15.or.inum.eq.-6)then
    res@tmYLLabelsOn           = True
    res@tmYLOn                 = True
    plot11 = gsn_csm_contour_map_ce(wks,tgrc(:,:,it), res)
    plot12 = gsn_csm_vector(wks,ugrc(::2,::2,it),vgrc(::2,::2,it),resV)
    overlay(plot11,plot12)
    end if

    if(inum.eq.6.or.inum.eq.9)then
    res@tmXBLabelsOn           = True
    res@tmXBOn                 = True
    plot11 = gsn_csm_contour_map_ce(wks,tgrc(:,:,it), res)
    plot12 = gsn_csm_vector(wks,ugrc(::2,::2,it),vgrc(::2,::2,it),resV)
    overlay(plot11,plot12)
    end if

    if(inum.eq.3)then
    res@tmXBLabelsOn           = True
    res@tmXBOn                 = True
    res@tmYLLabelsOn           = True
    res@tmYLOn                 = True
    plot11 = gsn_csm_contour_map_ce(wks,tgrc(:,:,it), res)
    plot12 = gsn_csm_vector(wks,ugrc(::2,::2,it),vgrc(::2,::2,it),resV)
    overlay(plot11,plot12)
    end if

    draw(plot11)

    plot(ip) = plot11

    res@tmYLLabelsOn           = False
    res@tmYLOn                 = False
    res@tmXBLabelsOn           = False
    res@tmXBOn                 = False

    end if
;~~~~~~~~~~~~ Add some text words
    txres               = True
    txres@txFontHeightF = 0.03
    gsn_text_ndc(wks,"IOD lead tauxy and ssta ",0.5,.95,txres)

  end do
   frame(wks)

;~~~~~~~~~~~~~~~~~~
; create panel
;~~~~~~~~~~~~~~~~~~
    resP            = True                         ; modify the panel plot
    resP@gsnFrame         = True                  ; don't advance panel plot
    resP@gsnMaximize           = True              ; make as large as possible
    resP@txString   = "IOD lead  tauxy and ssta "
    resP@gsnPanelLabelBar    = True                ; add common colorbar
    resP@lbLabelFontHeightF  = 0.020               ; make labels smaller
    resP@gsnPanelBottom    = 0.05                   ; add space at bottom
    resP@lbTopMarginF      = 0.1
;   resP@lbBoxMinorExtentF = .5
    resP@pmLabelBarHeightF = .1


   gsn_panel(wks,plot(0:11),(/4,3/),resP)               ; now draw as one plot


;~~~~~~~~~~~~ Add some text words
;    txres               = True
;    txres@txFontHeightF = 0.015
;    gsn_text_ndc(wks,"TIME = "+g_month+" month  ",0.5,0.02,txres)

;   frame(wks)

;  maximize_output(wks,True)
  exit

end


再次感谢您宝贵的 时间


密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2015-11-4 23:35:52 | 显示全部楼层
帮你顶
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2015-11-7 20:33:42 | 显示全部楼层

已解决  非常感谢
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2022-6-25 15:58:04 | 显示全部楼层
guizi 发表于 2015-11-7 20:33
已解决  非常感谢

请问如何解决的呀?
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2023-2-14 11:47:24 | 显示全部楼层
guizi 发表于 2015-11-7 20:33
已解决  非常感谢

请问如何解决的???
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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