<div dir="ltr"><div>I do not see anything 'wrong.'</div><div>Likely, the <b><a href="https://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_contour.shtml">gsn_contour</a> </b>function is doing something that negates your settings.</div><div>Likely, the <a href="https://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_csm_contour.shtml"><b>gsn_csm_contour </b></a>would recognize the 'YL' coordinate variable. but not the 'XB' labels.</div><div><br></div><div>Try:</div><div>res@tmYLValues = ispan(0,<b>dimsizes(</b>mh_reverse&level)-1,1)<br>res@tmYLLabels = (/"1000","975","950","925","900","875","850","825","800","775","750","700","650","600"/)<br></div><div><br></div><div>Good luck</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 21, 2020 at 12:49 PM Tabish Ansari via ncl-talk <<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Hi <br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">I am plotting a time series of vertical profiles of temperature using gsn_contour, and want to explicitly label the Y-axis with pressure levels (1000hPa up to 600hPa) but the Y-axis tickmarks and labels disappear on setting it to explicit mode. Could you please point out what am I doing wrong here?</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Here's the script:</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><i>load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/time_axis_labels.ncl"<br>;load "/data1/tabish/nclscripts/cd_inv_string.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/cd_string.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"<br><br>begin<br><br>a = addfile("/ichec/work/ngear013c/ERA5_t_1000-600hPa_27-30Jun2011.nc","r")<br>;READ 4D TEMPERATURE DATA FROM NC FILE. IT IS IN SHORT DATAYPE WITH SCALE FACTOR AND OFFSET AS METADATA<br>t = a->t<br>printVarSummary(t)<br><br>;READING MACE HEAD GRID VERTICAL PROFILE FOR ALL TIMES AND CONVERTING TO FLOAT ALONG WITH SCALING AND OFFSET USING SHORT2FLT FUNCTION<br>mh = short2flt(t(:,:,{53.3247},{360.0-9.9033})); mace head grid<br>ic = short2flt(t(:,:,{65},{360.0-30.0})); icelandic bloom source grid<br>ib = short2flt(t(:,:,{57},{360.0-26.0})); a grid in between the source and receptor<br><br>print("TIME SERIES OF VERTICAL TEMPERATURE PROFILES AT THE 3 GRIDS EXTRACTED SUCCESSFULLY!")<br> <br>printVarSummary(mh)<br>mh_reorder = mh(level|:,time|:)<br>ic_reorder = ic(level|:,time|:)<br>ib_reorder = ib(level|:,time|:)<br>mh_reverse = mh_reorder(::-1,:) ; reverses 0th dimension i.e. vert levels<br>ic_reverse = ic_reorder(::-1,:) ; reverses 0th dimension i.e. vert levels<br>ib_reverse = ib_reorder(::-1,:) ; reverses 0th dimension i.e. vert levels<br><br>wks = gsn_open_wks("x11","temperature_vertprofile_timeseries") ; open a workstation<br>gsn_define_colormap(wks,"BlAqGrYeOrReVi200")<br><br> res = True<br> res@vpHeightF = 0.20 ; height<br> res@gsnDraw = False ; don't draw<br> res@gsnFrame = False ; don't advance frame<br><br>;MAKE EXPLICIT TICKMARKS FOR Y-AXIS TO SHOW PRESSURE LEVELS<br> res@tmYLOn = True<br> res@tmYLMode = "Explicit" ; Define own tick mark labels.<br> res@tmYROn = False<br> res@tmXTOn = False<br> res@tmYLValues = (/1000,975,950,925,900,875,850,825,800,775,750,700,650,600/) ; location of explicit labels<br> res@tmYLLabelsOn = True<br> res@tmYLLabels = (/"1000","975","950","925","900","875","850","825","800","775","750","700","650","600"/)<br><br>;--------------------------------------------------<br>; The time_axis_label function adds additional<br>; resources to "res" to produce nicely-formatted<br>; time labels on X axis. This function only works<br>; if you have a time "units" recognized by the<br>; cd_calendar function.<br>;--------------------------------------------------<br> restick = True<br> restick@ttmFormat = "%D/%N/%Y"<br> restick@ttmMajorStride= 24<br> restick@ttmMinorStride= 6<br><br> timearr = ispan (0,95,1)<br> timearr@units = "hours since 2011-06-27 00:00:00"<br> time_axis_labels(timearr,res,restick)<br> res@trXMaxF=max(timearr)<br><br> res@tmXBLabelFontHeightF = 0.01<br> <br> res@gsnSpreadColors = True ; use full range of colors<br> res@cnFillOn = True ; turns on color fill<br> res@cnLevelSelectionMode = "ManualLevels" ; set levels manually<br> res@cnMinLevelValF = 260<br> res@cnMaxLevelValF = 280.<br> res@cnLevelSpacingF = 2<br> res@cnLinesOn = False<br> res@cnLineLabelsOn = False<br> res@cnInfoLabelOn = False<br><br>res@tiMainString = ""<br>plot1 = gsn_contour(wks,mh_reverse,res)<br>res@tiMainString = ""<br>plot2 = gsn_contour(wks,ic_reverse,res)<br>res@tiMainString = ""<br>plot3 = gsn_contour(wks,ib_reverse,res)<br><br><br>;************************************************<br>; create panel<br>;************************************************<br>resP = True<br>resP@gsnPanelMainString = "Temperature profile evolution over 4 days"<br>resP@gsnPanelYWhiteSpacePercent = 0.0<br>resP@gsnPanelLabelBar = True ; add common colorbar<br>resP@lbLabelFontHeightF = 0.007 ; make labels smaller<br><br>gsn_panel(wks,(/plot1,plot2,plot3/),(/3,1/),resP) ; now draw as one plot<br><br>end</i></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><i><br></i></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><i><br></i></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Thanks a lot in advance!</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Tabish</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div><span style="color:rgb(11,83,148)"><span style="font-family:verdana,sans-serif"></span><i><span style="font-family:verdana,sans-serif"><font size="1">Tabish U Ansari<br></font></span></i></span></div><span style="color:rgb(11,83,148)"><i><span style="font-family:verdana,sans-serif"><font size="1">Postdoctoral Researcher <br></font></span></i></span></div><div><span style="color:rgb(11,83,148)"><i><span style="font-family:verdana,sans-serif"><font size="1">Centre for Climate and Air Pollution Studies (C-CAPS)<br></font></span></i></span></div><div><span style="color:rgb(11,83,148)"><i><span style="font-family:verdana,sans-serif"><font size="1">School of Physics, NUI-Galway</font></span></i><font size="1"><span style="font-family:tahoma,sans-serif"><i><span style="font-family:verdana,sans-serif">, Ireland</span></i><br></span></font></span></div><div><span style="color:rgb(11,83,148)"><font size="1"><span style="font-family:tahoma,sans-serif"><i><span style="font-family:verdana,sans-serif">ResearchGate: <a href="https://www.researchgate.net/profile/Tabish_Ansari" target="_blank">https://www.researchgate.net/profile/Tabish_Ansari</a></span></i><br></span></font></span></div></div></div></div></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>