Re: Legend - blank box

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Aug 15 2013 - 10:11:42 MDT

Hi Guilherme,

Thanks for providing a script.

There's no way to tell the labelbar to not draw one of the labelbar boxes, unfortunately.

If you only want four boxes/colors, then you must set cnLevels to *3* values, and then do the appropriate thing to get four labels on your labelbar boxes.

You have contour levels (/1,2,3,4/). Are these levels supposed to represent exact values, or ranges of values?

Since you have labels "1", "2", "3", "4" at the box centers, this implies to me that your levels are supposed to represent exact values.

Since NCL's contouring doesn't allow for exact values, what I suggest is to use vaues that *straddle* the exact values you want, so you know you have the correct range:

res@cnLevels = (/1.5,2.5,3.5/)
res@cnFillColors = (/2,10,16,8,14/)
res@lbLabelAlignment = "BoxCenters" ; label orientation
res@lbLabelStrings = (/"1","2","3","4"/)

Note that I'm setting lbLabelAlignment and lbLabelStrings when I create the contour plots, and *not* when I'm creating the panel plots. This is because the panel code queries the first contour plot to get the information, and reconstructs the labelbar from that.


On Aug 14, 2013, at 6:17 PM, Guilherme Martins wrote:

> Hi users!
> In my figure in attach, I don't want the first blank box that is in legend appear. How can I remove it?
> In attach is my script.
> Thanks,
> Guilherme
> --
> Guilherme Martins
> <fig.ncl><fig.PNG>_______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Thu Aug 15 10:11:51 2013

This archive was generated by hypermail 2.1.8 : Wed Aug 21 2013 - 13:54:15 MDT