[ncl-talk] Unable to put labels on Xaxis and Y axis is elongated

Adam Phillips asphilli at ucar.edu
Mon Apr 26 09:43:29 MDT 2021


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   =  False
> 150              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

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210426/1c5204a1/attachment.html>


More information about the ncl-talk mailing list