[ncl-talk] Remove first box in the LabelBar
Mary Haley
haley at ucar.edu
Mon May 30 08:16:15 MDT 2016
Lillian,
The solution you came up with is pretty clever!
Another method is to set all values below some threshold value that you
don't want contoured to missing. For example:
threshold_val = 1.0
data = where(data.lt.threshold,data at _FillVaue,data)
This will set all values < 1.0 to missing, and hence you won't get any
filled contours in these locations.
Your solution works well, too. I will try to come up with some examples on
our web page, because this a common question.
--Mary
On Sun, May 29, 2016 at 10:26 PM, 林勤芳 <cflin at cwb.gov.tw> wrote:
> Hi Mary,
>
>
>
> Thanks for your reply. The problem is solved by your suggestion.
>
>
>
> The test1.png is a contour plot of precipitation. The first box is set as
> transparent, which will look like background color white in the labelbar.
> However, there is no white color in the contour plot. That’s why we want to
> remove the first box and keep all the label values.
>
>
>
> After including the following steps, the first box will be removed in
> test2.png:
>
> 1. Add one more extremely large value in cnLevels and cnFillColors.
>
> 2. Set cnLabelBarEndStyle = “ExcludeOuterBoxes”
>
> 3. Set the last string of lbLabelStrings as blank.
>
>
>
> Lillian
>
>
>
> *From:* Mary Haley [mailto:haley at ucar.edu]
> *Sent:* Saturday, May 28, 2016 12:40 AM
> *To:* 林勤芳
> *Cc:* ncl-talk at ucar.edu
> *Subject:* Re: [ncl-talk] Remoce first box in the LabelBar
>
>
>
> Hi Lillian,
>
>
>
> Is this a labelbar that's part of a contour or vector plot, or just one
> that you are trying to create from scratch?
>
>
>
> Generally, if somebody is trying to remove that first box, then my
> suggestion is to change your contour or vector levels so that first level
> is not included. But, I need to know more about what that first box
> represents. Is it just a white box that you are effectively using as a way
> to not draw any colored contours or vectors below a certain level?
>
>
>
> You might want to check out some of our labelbar examples:
>
>
>
> http://www.ncl.ucar.edu/Applications/labelbar.shtml
>
>
>
> In particular, example lb_12.ncl might be useful, or lb_5.ncl, which shows
> you how to chuck the labelbar that comes with the contour plot, and just
> create your own.
>
>
>
> --Mary
>
>
>
>
>
> On Wed, May 25, 2016 at 3:11 AM, 林勤芳 <cflin at cwb.gov.tw> wrote:
>
> Hi NCL group,
>
>
>
> I’m trying to remove the first box in the LabelBar. It seems like the
> lbBoxFractions function could work. But I didn’t success. Could you help me
> to check the following scripts?
>
>
>
> res at lbBoxCount = 3
>
> res at lbBoxSizing = ”Explicitsizing”
>
> res at lbBoxFractions = (/0.0, 0.0, 0.5, 1.0/)
>
>
>
> Thank you,
>
>
>
> Lillian
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160530/ece421bf/attachment.html
More information about the ncl-talk
mailing list