[ncl-talk] Unable to put labels on Xaxis and Y axis is elongated
Geeta Geeta
geetag54 at yahoo.com
Wed Apr 28 08:25:33 MDT 2021
Thanks for your mail Sir.
I rectified/ added the following for Y axis.
res at trXAxisType = "IrregularAxis"
; res at trXMinF = 0
; res at trXMaxF = 40
res at trYMinF = 0.5
res at trYMaxF = 18.0
For X axis ----
res at tmXBValues = (/longr(Fix_NSCAN,Fix_NP+20),longr(Fix_NSCAN,Fix_NP+16),longr(Fix_NSCAN,Fix_NP+12),longr(Fix_NSCAN,Fix_NP+08),longr(Fix_NSCAN,Fix_NP+04),longr(Fix_NSCAN,Fix_NP),longr(Fix_NSCAN,Fix_NP-04), longr(Fix_NSCAN,Fix_NP-08),longr(Fix_NSCAN,Fix_NP-12), longr(Fix_NSCAN,Fix_NP-16),longr(Fix_NSCAN,Fix_NP-20)/)
res at tmXBLabels = (/longr(Fix_NSCAN,Fix_NP+20),longr(Fix_NSCAN,Fix_NP+16),longr(Fix_NSCAN,Fix_NP+12),longr(Fix_NSCAN,Fix_NP+08),longr(Fix_NSCAN,Fix_NP+04),longr(Fix_NSCAN,Fix_NP),longr(Fix_NSCAN,Fix_NP-04), longr(Fix_NSCAN,Fix_NP-08),longr(Fix_NSCAN,Fix_NP-12), longr(Fix_NSCAN,Fix_NP-16),longr(Fix_NSCAN,Fix_NP-20)/)
Y axis is plotted and also shows 0.5, 1.5, 2.5 etc. How can I make it uniform say 1, 2, 3..... and so on.
Reg X axis, I specified both res at tmXBValues and res at tmXBlabels (same) but it is not shown in the plot.
Plot attatchedthanks again
Geeta.
On Monday, 26 April, 2021, 9:13:56 pm IST, Adam Phillips <asphilli at ucar.edu> wrote:
Hi Geeta,1 - Very minor, but you do not need to set gsnSpreadColors = True, as that is the default. 2 - You are not setting trXMinF/trXMaxF/trYMinF/trYMaxF, which sets the minimum/maximum x-axis values, and minimum/maximum y-axis values shown on the plot. You stated that the y-axis is elongated; if you mean it continues past a value of 18, try setting trYMaxF = 18.3 - When you set tmXBMode = "Explicit", the range of x-axis values specified in the 2nd input to gsn_csm_contour (in your case, 1000*profile(:,Fix_NSCAN,153:193)) needs to overlap with your settings of tmXBValues. If those two settings do not overlap, the X-axis labels will not be visible. Verify that those two settings overlap.
Hope that helps! If you have further questions please respond to the ncl-talk email list.Adam
On Sun, Apr 25, 2021 at 9:03 AM Geeta Geeta via ncl-talk <ncl-talk at mailman.ucar.edu> wrote:
Hi.
I am unable to put labels on the Xaxis inspite to specifying tm at XBValues and res at XBLabels. and the Ya xis is elongated
request someone to help me. I am attaching the figure so obtained.
Following are the res in the code.
res at tmXBMinorOn = False150 res at tmYLMinorOn = False
151 res at tmYLMode = "Explicit"
152 res at tmYLValues = Ht_of_layers
153 res at tmYLLabels = Ht_of_layers
154 ; defining X axis for all the plts together
155 Fix_NSCAN = 1036
156 Fix_NP = 173
157 xaxismin = Fix_NP+20
158 xaxismax = Fix_NP-20
159 xaxisinterval = 1
160 int_for_plot = 4
161
162 xaxis_fnl = ispan(xaxismin,xaxismax,xaxisinterval)
163 print(xaxis_fnl)
164 xaxis_for_plotting = ispan(xaxismin,xaxismax,int_for_plot)
165 printVarSummary(xaxis_for_plotting)
166 print(xaxis_for_plotting)
167
168 res at tmXBMode = "Explicit" ; will change from case to case
169 ; res at tmXBValues = xaxis_for_plotting
170 res at tmXBValues = (/longr(Fix_NSCAN,Fix_NP+20),longr(Fix_NSCAN,Fix_NP+16),longr(Fix_NSCAN,Fix_NP+12),longr(Fix_NSCAN,Fix_NP +08),longr(Fix_NSCAN,Fix_NP+04),longr(Fix_NSCAN,Fix_NP),longr(Fix_NSCAN,Fix_NP-04), longr(Fix_NSCAN,Fix_NP-08),longr(Fix_NSCAN,Fix_NP-12), longr(Fix_NSCAN,Fix_NP-16),longr(Fix_NSCAN,Fix_NP-20)/)
171 res at tmXBLabels = (/longr(Fix_NSCAN,Fix_NP+20),longr(Fix_NSCAN,Fix_NP+16),longr(Fix_NSCAN,Fix_NP+12),longr(Fix_NSCAN,Fix_NP +08),longr(Fix_NSCAN,Fix_NP+04),longr(Fix_NSCAN,Fix_NP),longr(Fix_NSCAN,Fix_NP-04), longr(Fix_NSCAN,Fix_NP-08),longr(Fix_NSCAN,Fix_NP-12), longr(Fix_NSCAN,Fix_NP-16),longr(Fix_NSCAN,Fix_NP-20)/)
172
173
174 print(res at tmXBLabels)
175 print(res at tmXBValues)
176 ; res at tmXBLabels = decimalPlaces(restmXBLabels,2,True)
177
Geeta._______________________________________________
ncl-talk mailing list
ncl-talk at mailman.ucar.edu
List instructions, subscriber options, unsubscribe:
https://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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210428/63266af1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2A12.20090521.65597.7.HDF.png
Type: image/png
Size: 44214 bytes
Desc: not available
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210428/63266af1/attachment.png>
More information about the ncl-talk
mailing list