Re: Labelbar Problem !!

From: louis Vonder <appopson_at_nyahnyahspammersnyahnyah>
Date: Sat, 9 May 2009 06:31:27 +0000 (GMT)

Many Thanks Adam and Mary.

I applied your suggestions and every thing is going right now.

Louis

--- En date de : Ven 8.5.09, Mary Haley <haley_at_ucar.edu> a écrit :

De: Mary Haley <haley_at_ucar.edu>
Objet: Re: [ncl-talk] Labelbar Problem !!
À: "louis Vonder" <appopson_at_yahoo.fr>
Cc: "ncl forum" <ncl-talk_at_ucar.edu>
Date: Vendredi 8 Mai 2009, 18h04

Louis,

I assume you mean "labelbar" instead of "label"?

If so, there are two possible problems.

One is that you are setting:

   res_at_vpXF      = 0.1
   res_at_vpWidthF  = 0.9
   res_at_vpYF      = 0.9
   res_at_vpHeightF = 0.8

The width is for the plot area only, and doesn't include the area that
contains all the annotations, like tickmarks, tickmark labels, titles,
and labelbars.

You've made the width 0.9, and started the plot at position 0.1,
so the right edge of the plot is now up against the edge
of the viewport. You won't be able to see the labelbar or anything
else to the right of the plot area.

You can try making vpXF smaller, like 0.05, and/or making the
width/height a little smaller.

The second possible problem is that:

   res_at_pmLabelBarOrthogonalPosF = 0.05          ; move label bar closer

may be set to too large a value, causing the labelbar to move outside
the viewport.

Once you fix the above width problem, then you might need to adjust
this value as well. Try these for a start:

   res_at_pmLabelBarOrthogonalPosF =  0.01
   res_at_pmLabelBarOrthogonalPosF = -0.05

--Mary

On Fri, 8 May 2009, louis Vonder wrote:

>

p, li { white-space: pre-wrap; }

Dear Ncl users,
>
> I am wondering why my label does not appear on my figure !!
>
> Here the script I am using, inspired from ncl page
>
> I also attached the figure produced
>
> Regards
>
> ;************************************************
> 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/shea_util.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> ;************************************************
>
> begin
> ;************************************************
> ; read in netCDF files
> ;************************************************
>   a = addfile("XXXU_vect_025_253K.nc", "r")
>   b = addfile("XXXV_vect_025_253K.nc", "r")
>   c = addfile("mat_ampli_025_253K.nc", "r")
>
>
>   u = a->u                           
>   v = b->v
>   fc = c->FC
>   lat = a->lat
>   lon = a->lon
>
> ;************************************************
> ; create plot
> ;************************************************
>   wks = gsn_open_wks("eps", "vector_ampli_025_253K")                   ; open a ps file
>   gsn_define_colormap(wks, "BlAqGrYeOrRevi200")  ; choose color map
>
>
>   res                         = True             ; plot mods desired
>   res_at_gsnFrame                = False            ; so we can draw time stamp
>
>
>  ;********************************************
>  ;**************** MAP SETTINGS  **********
>  ;********************************************
>     res_at_mpDataBaseVersion           = "Ncarg4_1"       ; use finer database
>     res_at_pmTickMarkDisplayMode       = "Always"         ; turn on tickmarks
>     res_at_mpGeophysicalLineThicknessF = 2.5          ; thickness of outlines
>     res_at_mpNationalLineThicknessF    = 2.5
>     res_at_mpOutlineBoundarySets       = "National"   ; turn on country boundaries
>     res_at_gsnAddCyclic                = False            ; regional data, don't add pt
>         res_at_mpPerimOn             = True
>     res_at_mpFillOn              = False              ; turn off map fill
>  
>         res_at_mpMinLonF            =  min(lon)               ; select a subregion
>         res_at_mpMaxLonF            =  max(lon)
>         res_at_mpMinLatF            =  min(lat)
>         res_at_mpMaxLatF            =  max(lat)
>
>
>
>  ;********************************************
>  ;**************** CONTOURS SETTINGS  ********
>  ;********************************************
>
>   res_at_cnFillOn             = True               ; turn on color for contours
>   res_at_cnLinesOn            = False              ; turn off contour lines
>   res_at_cnLineLabelsOn       = False              ; turn off contour line labels
>   res_at_gsnScalarContour     = True               ; contours desired
>   res_at_gsnSpreadColors      = True               ; use full color map
>   res_at_gsnSpreadColorStart  = 17                 ; start at color 17
>   res_at_gsnSpreadColorEnd    = 200                ; end at color 200
>
>    res_at_lbLabelBarOn                = True
>    res_at_lbOrientation            = "vertical"     ; vertical label bar
>   res_at_pmLabelBarOrthogonalPosF = 0.05          ; move label bar closer
>   ; res_at_lbLabelStride            = 4
>   res_at_cnLevelSelectionMode = "AutomaticLevels"     ; set manual contour levels
>
>
>  ;********************************************
>  ;**************** VECTOR SETTINGS  **********
>  ;********************************************
>   res_at_vcRefAnnoOrthogonalPosF = -1.0             ; move ref vector up
>   res_at_vcRefMagnitudeF         = 50.0             ; define vector ref mag
>   res_at_vcRefLengthF            = 0.045            ; define length of vec ref
>   res_at_vcMinDistanceF          = 0.015
>   res_at_gsnAddCyclic            = False
>
>   ;;*********  LABELS
>   res_at_gsnLeftString   = " "              ; add the gsn titles
>   res_at_gsnCenterString = " "
>   res_at_gsnRightString  = " "
>   res_at_gsnStringFont = " "            ; set gsnLeft/Center/RightString font
>                                           ; to helvetica-bold from default
>   res_at_gsnLeftStringFontHeightF   = 0.00        ; instead of using txFontHeightF or gsnStringFontHeightF
>   res_at_gsnCenterStringFontHeightF = 0.00            ; to set the gsnLeft/Center/RightString font heights,
>   res_at_gsnRightStringFontHeightF  = 0.00        ; individually set each string's font height.
>
>
>   res_at_vpXF            = 0.1        
>   res_at_vpWidthF        = 0.9       
>   res_at_vpYF            = 0.9
>   res_at_vpHeightF       = 0.8
>
>   res_at_tmXBLabelFontHeightF = 0.02
>   res_at_tmBorderThicknessF   = 3.0
>
>
>   plot = gsn_csm_vector_scalar_map_ce(wks, u, v, fc, res)
>
>
>   frame (wks) 
> end
>
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat May 09 2009 - 00:31:27 MDT

This archive was generated by hypermail 2.2.0 : Mon May 11 2009 - 09:43:46 MDT