[ncl-talk] Issue with Latitude-Time Plot
Adam Phillips
asphilli at ucar.edu
Tue Aug 28 10:32:31 MDT 2018
Hi Amit,
Try this:
res at tmXBMode = "Explicit"
res at tmXBValues = var&time
res at tmXBLabels = ispan(0,115,5)
res at tmXBLabelFontHeightF = 0.01
res at tmXBMinorValues = ispan(0,115,1)
Adam
On Tue, Aug 28, 2018 at 8:26 AM Amit Kumar <amitkumar.777 at hotmail.com>
wrote:
> Dear All,
>
> When I'm following as mentioned in example 2, then no labels are getting
> printed on x axis.
>
> Regards
> Amit
>
>
>
> Get Outlook for Android <https://aka.ms/ghei36>
>
> ------------------------------
> *From:* Rick Brownrigg <brownrig at ucar.edu>
> *Sent:* Tuesday, August 28, 2018 6:23:43 PM
> *To:* Amit Kumar
> *Subject:* Re: [ncl-talk] Issue with Latitude-Time Plot
>
> You might look at "*tmXBMinorValues* " at
>
> http://ncl.ucar.edu/Document/Graphics/Resources/tm.shtml
>
> and example #2 at
>
> http://ncl.ucar.edu/Applications/tickmarks.shtml
>
> for dealing with minor tickmarks when using tmXBMode = "Explicit"
>
> On Tue, Aug 28, 2018 at 12:37 AM, Amit Kumar <amitkumar.777 at hotmail.com>
> wrote:
>
>> Hi All,
>>
>>
>> I've made following changes as suggested by Adam in the script,
>>
>>
>> res at tmXBMode = "Explicit"
>> res at tmXBValues = var&time
>> res at tmXBLabels = ispan(0,115,1)
>> res at tmXBLabelFontHeightF = 0.01
>> res at tmXBLabelStride = 10
>>
>> Now as it can be seen from the image that all the labels are major
>> labels, is there a way to define all other tickmarks except for which label
>> is mentioned as minor tickmarks.
>>
>>
>> Regards
>>
>> Amit
>>
>>
>> ------------------------------
>> *From:* Adam Phillips <asphilli at ucar.edu>
>> *Sent:* Monday, August 27, 2018 9:51 PM
>> *To:* Amit Kumar
>> *Cc:* Rick Brownrigg; Ncl-talk
>> *Subject:* Re: [ncl-talk] Issue with Latitude-Time Plot
>>
>> Hi Amit,
>> You can override the behavior of the bottom x-axis tick mark labels by
>> setting:
>> res at tmXBMode = "Explicit"
>> res at tmXBValues = OLR_DAY&time
>> res at tmXBLabels = ispan(1,115,1)
>>
>> See tickmarks example #2 here (bottom panel coding):
>> http://www.ncl.ucar.edu/Applications/tickmarks.shtml#ex2
>> Tick marks - University Corporation for Atmospheric Research
>> <http://www.ncl.ucar.edu/Applications/tickmarks.shtml#ex2>
>> www.ncl.ucar.edu
>> NCL graphics examples page. Describes various tick mark resources and
>> ways to manage the tick marks.
>>
>>
>> If you have further questions please post them to ncl-talk.
>> Adam
>>
>> On Mon, Aug 27, 2018 at 9:51 AM Amit Kumar <amitkumar.777 at hotmail.com>
>> wrote:
>>
>> Dear Rick,
>>
>> Actually these 115 time stamps are for each day. I have concatenated to
>> these individual days into one using cdo. I want to plot time at x axis
>> which will vary from 1 to 115 indicating each day, so that the plot can be
>> ploted as latitude vs time and variation of olr can be seen over latitude
>> and time . It is on the same lines as the example for sst anamoly in
>> latitude vs time section in ncl examples.
>>
>> Regards
>> Amit
>>
>>
>>
>>
>> Get Outlook for Android <https://aka.ms/ghei36>
>>
>> ------------------------------
>> *From:* Rick Brownrigg <brownrig at ucar.edu>
>> *Sent:* Monday, August 27, 2018 8:47:24 PM
>> *To:* Amit Kumar
>> *Subject:* Re: [ncl-talk] Issue with Latitude-Time Plot
>>
>> Hi Amit,
>>
>> Offhand, given the time variable's coordinate range:
>>
>> Variable: time
>> Type: double
>> Total Size: 115 values
>> 920 bytes
>> Number of Dimensions: 1
>> Dimensions and sizes: [ 115 <time | unlimited> ]
>> Chunking Info: [ 524288 <time> ]
>> Coordinates:
>> time: [9159840..9334080]
>>
>> I'd the plot looks about what I'd expect. In what way do you think the
>> time values are incorrect?
>>
>> Rick
>>
>>
>> On Mon, Aug 27, 2018 at 6:02 AM, Amit Kumar <amitkumar.777 at hotmail.com>
>> wrote:
>>
>> Dear All,
>>
>>
>> I'm trying to plot Latitude vs Time Plot. It is working fine when I've 30
>> time instances, but for greater then that (i.e. 115 time steps) the plot is
>> sowing different values in x-axis (time).
>>
>>
>> I'm not able to workout why this is happening? I'm attaching the output
>> and my ncl script.
>>
>>
>>
>> ==================================================================================================
>>
>>
>> var = a->OLR_DLY
>> dims = dimsizes(var)
>> print(dims)
>> lat = a->lat
>> lon = a->lon
>> time = a->time
>>
>> lon100E = ind(lon.eq.100.) ; subscript at 90E
>> latS = -20.
>> latN = 40.
>> shov = var(lon|lon100E:lon100E,{lat|latS:latN},time|:)
>> dims = dimsizes(shov) ; shov=3D array=(1,31,127)
>> sdemo = onedtond(ndtooned(shov), (/dims(1),dims(2)/) )
>> sdemo!0 = "lat"
>> sdemo!1 = "time"
>> sdemo&lat = lat({lat|latS:latN})
>> sdemo&time= time
>>
>> sdemo = smth9 (sdemo,0.5, 0.25, False) ; 2D smoother
>>
>> gtPat = 17 ; stiple
>> ltPat = 3 ; hatch
>> ;*************************
>> ; plotting parameters
>> ;*************************
>> wks = gsn_open_wks ("png", "Monsoon_2017_lat_time_100_1" ) ; send
>> graphics to PNG file
>> res = True ; plot mods desired
>> res at gsnDraw = False ; don't draw yet
>> res at gsnFrame = False ; don't advance frame yet
>>
>> res at tiMainString = "Daily OLR variation at 100E" ; title
>>
>> res at vpXF = 0.12 ; default is 0.2 change aspect
>> res at vpYF = 0.8 ; default is 0.8 ration
>> res at vpHeightF = 0.4 ; default is 0.6
>> res at vpWidthF = 0.8 ; default is 0.6
>>
>> res at cnLevelSelectionMode = "ManualLevels" ; manual levels
>> res at cnMinLevelValF = 150. ; min level
>> res at cnMaxLevelValF = 330. ; max level
>> res at cnLevelSpacingF = 10 ; contour spacing
>>
>> res at cnFillOn = True ; color on
>> res at lbLabelStride = 4 ; every other label
>> res at lbOrientation = "Horizontal" ; vertical label bar
>> res at pmLabelBarOrthogonalPosF = -0.04 ; move label bar closer to
>> axis
>> res at cnLinesOn = False ; turn off contour lines
>> res at cnFillPalette = "GMT_wysiwyg" ; set color map
>>
>>
>> plot = gsn_csm_lat_time(wks, sdemo, res )
>> ;opt = True
>> ;opt at gsnShadeFillType = "pattern"
>> ;opt at gsnShadeLow = ltPat
>> ;opt at gsnShadeHigh = gtPat
>> ;plot = gsn_contour_shade(plot, -0.69, 0.25, opt)
>> ;plot = ZeroLineContour (plot)
>> draw (plot) ; draw the contour object
>> frame (wks) ; advance frame
>> end
>>
>> ==================================================================================================
>> %%%%%%%%%%%%%%%%%%%
>> ################################
>>
>> dimensions:
>> lon = 1400
>> lat = 1400
>> time = 115 // unlimited
>>
>> chunk dimensions:
>> lon = 1400
>>
>> variables:
>> Variable: lon
>> Type: double
>> Total Size: 1400 values
>> 11200 bytes
>> Number of Dimensions: 1
>> Dimensions and sizes: [ 1400 <lon> ]
>> Coordinates:
>> lon: [40..109.95]
>> Number of Attributes: 4
>> standard_name : longitude
>> long_name : longitude
>> units : degrees_east
>> axis : X
>>
>> Variable: lat
>> Type: double
>> Total Size: 1400 values
>> 11200 bytes
>> Number of Dimensions: 1
>> Dimensions and sizes: [ 1400 <lat> ]
>> Coordinates:
>> lat: [-20..49.95]
>> Number of Attributes: 4
>> standard_name : latitude
>> long_name : latitude
>> units : degrees_north
>> axis : Y
>>
>> Variable: time
>> Type: double
>> Total Size: 115 values
>> 920 bytes
>> Number of Dimensions: 1
>> Dimensions and sizes: [ 115 <time | unlimited> ]
>> Chunking Info: [ 524288 <time> ]
>> Coordinates:
>> time: [9159840..9334080]
>> Number of Attributes: 4
>> standard_name : time
>> units : minutes since 2000-1-1 00:00:00
>> calendar : standard
>> axis : T
>>
>> Variable: OLR_DLY
>> Type: float
>> Total Size: 225400000 values
>> 901600000 bytes
>> Number of Dimensions: 3
>> Dimensions and sizes: [ 115 <time | unlimited> x 1400 <lat> x
>> 1400 <lon> ]
>> Chunking Info: [ 1 <time> x 1 <lat> x 1400 <lon> ]
>> Coordinates:
>> time: [9159840..9334080]
>> lat: [-20..49.95]
>> lon: [40..109.95]
>> Number of Attributes: 5
>> standard_name : Outgoing Longwave Radiation
>> long_name : Out Longwave Radiation(Daily)
>> units : W.m-2
>> _FillValue : -999
>> missing_value : -999
>>
>>
>> ########################################
>>
>> Thanks in advance.
>>
>> Regards
>> Amit
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>>
>> --
>> Adam Phillips
>> Associate Scientist, Climate and Global Dynamics Laboratory, NCAR
>> www.cgd.ucar.edu/staff/asphilli/ 303-497-1726
>>
>> <http://www.cgd.ucar.edu/staff/asphilli>
>>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
--
Adam Phillips
Associate Scientist, Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/ 303-497-1726
<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180828/cba709c4/attachment.html>
More information about the ncl-talk
mailing list