Re: break the y-axis and give different scales

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Thu, 18 Oct 2007 13:37:23 -0600

Hi Murat,

(All, Murat sent his data file and script offline to us...)

I modified your script to do what you wanted.. (see attachments) I drew
2 separate plots, one for above 100m, and one for below. I then used the
vp resources (vpYF, vpHeightF) to place the 2 plots on the page exactly
where I wanted them. Hopefully, this was what you were looking for... If
not, let us know...
Best regards,
Adam

Murat Gunduz wrote:
>
> Hi, all
>
> I would like to generate a temperature vs depth plot,
> with the upper 100m is different y-axis scale than the rest
> (i.e break the y-axis at 100m and give two different scale)
> to zoom the upper 100m.
>
> Is it possible the break y-axis and give two
> different scale in NCL?
>
> Thank you very much in advance for your reply.
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli


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"
;************************************
begin
;
;
;
 lStrt = 5
 lLast = 305

  in = addfile("archMN.035_a_3zv.nc","r")
  t2a = in->v(0,{lStrt:lLast},51,:)
  t2 = t2a(:,:)
  t2 = t2*100
  t2_at_units = "cm/s"
;
;********************************
; create plot
;********************************

  type = "ps"
; type_at_wkOrientation = "landscape"
  type_at_wkColorModel = "cmyk" ; make output cmyk

  wks = gsn_open_wks(type, "sample")

  gsn_define_colormap(wks,"nrl_sirkes") ; choose colormap

;
  res = True ; plot mods desired
  res_at_cnFillOn = True ; turn on color
  res_at_lbLabelAutoStride = True ; nice label bar label stride
  res_at_gsnSpreadColors = True ; use full range of colormap
  res_at_cnLinesOn = False ; turn off countour lines
  res_at_cnRasterModeOn = True ; Raster Mode
  res_at_cnFillDrawOrder = "PreDraw" ; draw fill first

; res_at_gsnMaximize = True
  res_at_trYReverse = True ; reverse y axis
  res_at_gsnYAxisIrregular2Linear = True ; converts irreg depth to linear
;
  res_at_gsnLeftString = ""
  res_at_gsnRightString = ""
;
  res_at_gsnPaperOrientation = "portrait"
  res_at_cnLevelSelectionMode = "ManualLevels"
  res_at_cnMinLevelValF = -1.9
  res_at_cnMaxLevelValF = 2.0
  res_at_cnLevelSpacingF = 0.3
  res_at_cnInfoLabelOn = False ; turns off contour info label

  res_at_tmXBLabels = ""
  res_at_tmXBLabelsOn = False

  res_at_lbOrientation = "vertical" ; vertical label bar
  res_at_lbLabelAutoStride = True ; nice label bar label stride
  res_at_lbLabelBarOn = False
  res_at_vpWidthF = 0.35
  res_at_vpHeightF = 0.4
  res_at_vpYF = 0.9
  res_at_gsnFrame = False

  res_at_tmXBOn = False
  res_at_tmXBBorderOn = False
  plot =gsn_csm_contour(wks,t2({:100},:),res) ; create 1st plot for top 100m
  res_at_tmXBBorderOn= True
  res_at_vpYF = 0.5
  res_at_lbLabelBarOn = True
  res_at_tmXBOn = True
  res_at_tmXTOn = False
  res_at_pmLabelBarParallelPosF = 1.035 ; raise label bar up
; res_at_tmXTBorderOn= False
  plot2 =gsn_csm_contour(wks,t2({100:},:),res) ; create 2nd plot for 100-300m
  frame(wks)
  system("ghostview sample.ps")
end

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

sample.gif
Received on Thu Oct 18 2007 - 13:37:23 MDT

This archive was generated by hypermail 2.2.0 : Mon Oct 22 2007 - 14:48:46 MDT