[ncl-talk] Help with line labels

Laura Fowler laura at ucar.edu
Mon Dec 18 10:58:33 MST 2017


Hi Adam:

Thanks for your suggestion over the week-end. I did try it and it
still did not work. I grouped the sres resources, including yours,
that I now have:

sres = True

sres at gsnDraw             = False
sres at gsnFrame            = False
sres at gsnMaximize         = False
sres at cnFillMode          = "AreaFill"
sres at cnFillOn            = False
sres at cnLinesOn           = True
sres at cnLineLabelsOn      = True
sres at cnLineThicknessF    = 3.4
sres at cnInfoLabelOn       = False


sres at cnLineLabelPlacementMode = "Constant"
sres at cnLineLabelFontHeightF   = 0.02
sres at cnLineDashSegLenF        = 0.35
sres at cnLineLabelInterval      = 1


sres at cnLevelSelectionMode = "ExplicitLevels"
sres at cnLevels             = (/4.8,9.6,14.4/)
sres at cnMonoLineColor      = False
sres at cnLineColors         = (/"red","blue","black"/)
sres at cnMonoLevelFlag      = True
sres at cnLevelFlag          = "LineAndLabel"


I copied the script to test.ncl (that I won't modify except for your
sugggestions) in the same directory so that I can keep working on my
original version. I reread the web pages and examples and cannot see
what I am still missing?

Laura




On Fri, Dec 15, 2017 at 10:35 PM, Adam Phillips <asphilli at ucar.edu> wrote:
> Hi Laura,
> I just looked at the resources I have set in the past to get numerous line
> labels on plots:
> sres at cnLineLabelPlacementMode = "Constant"   ;Default is randomized
> sres at cnLineLabelFontHeightF = 0.02       ;Size of labels
> sres at cnLineDashSegLenF = 0.35          ;Spacing between labels
> sres at cnLineLabelInterval = 1        ;Label every line
>
> Give those a shot and let ncl-talk know the result.
> Adam
>
> On Fri, Dec 15, 2017 at 5:24 PM, Laura Fowler <laura at ucar.edu> wrote:
>>
>> Hi Adam:
>>
>> Thanks for sending me an e-mail earlier (to which I replied). As an
>> experiment, I reverted to ncl choosing the levels instead of choosing
>> the levels using "Explicit Levels". As expected, the new plot shows a
>> bunch of contour lines, but without any labels. I also added the lines
>> draw(plot) and frame(wks). That did not help either. So I am really
>> baffled as why ncl refuses to add labels to my plot.
>>
>> Thanks,
>> Laura
>>
>>
>>
>>
>> On Fri, Dec 15, 2017 at 4:28 PM, Adam Phillips <asphilli at ucar.edu> wrote:
>> > Hi Laura,
>> > I believe NCL will limit the drawing of line labels if it believes they
>> > will
>> > come close to overlapping, although in this case I'm not sure why it
>> > doesn't
>> > simply draw one for each line.
>> > See example #5 here:
>> > http://www.ncl.ucar.edu/Applications/contourLab.shtml#ex5
>> > and try setting cnLineLabelPlacementMode = "constant"
>> > and see if that helps. Other examples show how to make sure labels are
>> > drawn
>> > on every line (as opposed to the default behavior of skipping every
>> > other
>> > one.), along with other modifications.
>> > Adam
>> >
>> > On Fri, Dec 15, 2017 at 4:16 PM, Laura Fowler <laura at ucar.edu> wrote:
>> >>
>> >> Hello:
>> >>
>> >> I have been fussing for quite a while on how to draw labels on the
>> >> contour line of the attached plot. The 3 contours show the resolution
>> >> of my variable-resolution mesh. The red, blue, and black contours
>> >> correspond to a resolution of 4.8 km, 9.6, and 14.4 km, respectively.
>> >> I am not understanding why I am unable to add at least one label per
>> >> contour?
>> >>
>> >> sres = True
>> >>
>> >> sres at gsnDraw          = False
>> >> sres at gsnFrame         = False
>> >> sres at gsnMaximize      = False
>> >> sres at cnFillMode       = "AreaFill"
>> >> sres at cnFillOn         = False
>> >> sres at cnLinesOn        = True
>> >> sres at cnLineLabelsOn   = True
>> >> sres at cnLineThicknessF = 3.4
>> >> sres at cnInfoLabelOn    = False
>> >>
>> >> sres at cnLevelSelectionMode = "ExplicitLevels"
>> >> sres at cnLevels             = (/4.8,9.6,14.4/)
>> >> sres at cnMonoLineColor      = False
>> >> sres at cnLineColors         = (/"red","blue","black"/)
>> >> sres at cnMonoLevelFlag      = True
>> >> sres at cnLevelFlag         = "LineAndLabel"
>> >>
>> >> There must be something I am missing, or I am getting confused between
>> >> sres at cnLevelFlag and sres at cnLevelFlags, but I just can't make it work?
>> >> I know that it may be a little finnicky to add labels at times, ....
>> >> Would somebody be able to help me out so that I do not have to add
>> >> those labels in PowerPoint. If interested, my entire ncl script is in
>> >>
>> >>
>> >> /glade2/scratch2/laura/MPAS.PacificOcean/plots.centeredPacificOceanMesh.15-3km.20151129-20151231
>> >> (see global_mean.precipitation.ncl).
>> >>
>> >>
>> >> Many thanks,
>> >> Laura
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >>
>> >>
>> >> !-------------------------------------------------------------------------------------------------------------
>> >> Laura D. Fowler
>> >> Mesoscale and Microscale Meteorology Division (MMM)
>> >> National Center for Atmospheric Research
>> >> P.O. Box 3000, Boulder CO 80307-3000
>> >>
>> >> e-mail: laura at ucar.edu
>> >> phone: 303-497-1628
>> >>
>> >>
>> >>
>> >> !-------------------------------------------------------------------------------------------------------------
>> >>
>> >> _______________________________________________
>> >> 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
>> >
>>
>>
>>
>> --
>>
>> !-------------------------------------------------------------------------------------------------------------
>> Laura D. Fowler
>> Mesoscale and Microscale Meteorology Division (MMM)
>> National Center for Atmospheric Research
>> P.O. Box 3000, Boulder CO 80307-3000
>>
>> e-mail: laura at ucar.edu
>> phone: 303-497-1628
>>
>>
>> !-------------------------------------------------------------------------------------------------------------
>
>
>
>
> --
> Adam Phillips
> Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
> www.cgd.ucar.edu/staff/asphilli/   303-497-1726
>



-- 
!-------------------------------------------------------------------------------------------------------------
Laura D. Fowler
Mesoscale and Microscale Meteorology Division (MMM)
National Center for Atmospheric Research
P.O. Box 3000, Boulder CO 80307-3000

e-mail: laura at ucar.edu
phone: 303-497-1628

!-------------------------------------------------------------------------------------------------------------


More information about the ncl-talk mailing list