Re: gsn_labelbar_ndc

From: Mary Haley (haley AT XXXXXX)
Date: Wed Jan 15 2003 - 13:08:22 MST

  • Next message: David Reusch: "Re: Re: OS X follow up..."

    >
    > Mary,
    >
    > I did get this working. Thank you again.
    > Matt
    >

    I'll go ahead and answer this, so that others can benefit.

    In order to used "named" colors like "yellow", "red", etc, they have
    to be in your current colormap, otherwise you might not get what you
    expect. Every named color has a specific RGB value associated with
    it, so NCL will find the closest color in your colormap that matches
    it, and then it will use this.

    --Mary

    > Matt Fearon wrote:
    >
    > > Mary,
    > >
    > > Thank you. This is great. Also, would it be possible to customize
    > > the colors in the labelbar. I thought this might work;
    > >
    > > lbres@lbFillColors = (/"yellow","red","blue","black"/)
    > >
    > > but it does not. How might customize the colors in the labelbar?
    > > Do the colors have to come from the gsn_define_colormap?
    > > Thank you again for your response.
    > >
    > > Matt
    > >
    > >
    > >
    > > Mary Haley wrote:
    > >
    > >>>matt,
    > >>>
    > >>>you may be missing:
    > >>>
    > >>>res@pmLabelBarDisplayMode = "Always" ; turns on label bar
    > >>>see
    > >>>
    > >>>http://echorock.cgd.ucar.edu/csm/support/CSM_Graphics/Scripts/lb_5.ncl
    > >>>for my web example of creating a colorbar from scratch
    > >>>
    > >>>
    > >>>
    > >>
    > >>But Matt is using gsn_labelbar_ndc which directly creates a labelbar,
    > >>so no pm* resources are going to affect his labelbar. The pm* resources
    > >>only come into effect when you have a labelbar associated with a plot.
    > >>The URL you gave doesn't create a labelbar from scratch. It uses the
    > >>labelbar automatically generated by the contour plot, and then it
    > >>sets some resources to change the look of it.
    > >>
    > >>In Matt's case, the reason why the lbPerimOn resource is not working
    > >>is because you need an "lbres@" in front of it.
    > >>
    > >>As for the lbFillPattern resource, if you want solid fill for each
    > >>box, you need to also set lbMonoFillPattern to True. The default is
    > >>False, which means it's going to use different fill patterns for each
    > >>box.
    > >>
    > >>Your final resource list might look something like this:
    > >>
    > >> lbres = True
    > >> lbres@lbAutomanage = False
    > >> lbres@lbLabelFontHeightF = 0.013
    > >> lbres@vpHeightF = .09
    > >> lbres@vpWidthF = .5
    > >> lbres@lbPerimOn = False
    > >> lbres@lbFillPattern = "SolidFill"
    > >> lbres@lbMonoFillPattern = True
    > >>
    > >> gsn_labelbar_ndc(wks,4,labels,0.4,0.2,lbres)
    > >>
    > >>--Mary
    > >>
    > >>
    > >>
    > >>>On Wed,
    > >>>15 Jan 2003, Matt Fearon wrote:
    > >>>
    > >>>
    > >>>
    > >>>>Dear NCL users:
    > >>>>
    > >>>>I am trying to use the gsn_labelbar_ndc procedure to add
    > >>>>a labelbar into the viewport. However, I am having trouble
    > >>>>modifying the labelbar resources - many of resources are
    > >>>>seemingly being ignored, i.e., the resources with asterisks in
    > >>>>front are the only ones that seem to be working;
    > >>>>
    > >>>>*lbres = True
    > >>>>lbres@lbAutoManage = False
    > >>>>*lbres@lbLabelFontHeightF = 0.013
    > >>>>* lbres@vpHeightF = .09
    > >>>>*lbres@vpWidthF = .5
    > >>>>lbPerimOn = False
    > >>>>lbres@lbFillPattern = "SolidFill"
    > >>>>gsn_labelbar_ndc(wks,4,labels,0.4,0.2,lbres)
    > >>>>
    > >>>>Is there a resource I can set that will allow me to custom the labelbar?
    > >>>>thank you,
    > >>>>Matt
    > >>>>
    > >>>>
    > >>>>
    > >>>>_______________________________________________
    > >>>>ncl-talk mailing list
    > >>>>ncl-talk AT ucar.edu
    > >>>>http://mailman.ucar.edu/mailman/listinfo/ncl-talk
    > >>>>
    > >>>>
    > >>>>
    > >>>******************************************************
    > >>>Sylvia Murphy EML: murphys AT ucar.edu
    > >>>NCAR CGD/CAS PHN: 303-497-1720
    > >>>3080 Center Green Drive FAX: 303-497-1333
    > >>>Boulder CO 80301
    > >>>
    > >>>
    > >>>WEB: http://www.cgd.ucar.edu/csm/support/
    > >>> http://www.cgd.ucar.edu/csm/support/CSM_Graphics/
    > >>>******************************************************
    > >>>
    > >>>
    > >>>
    > >>>_______________________________________________
    > >>>ncl-talk mailing list
    > >>>ncl-talk AT ucar.edu
    > >>>http://mailman.ucar.edu/mailman/listinfo/ncl-talk
    > >>>
    > >>>
    > >>>
    > >>
    > >>
    > >>
    >
    >
    > --------------080803070804020205090708
    > Content-Type: text/html; charset=us-ascii
    > Content-Transfer-Encoding: 7bit
    >
    > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    > <html>
    > <head>
    > <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
    > <title></title>
    > </head>
    > <body>
    > Mary,<br>
    > <br>
    > I did get this working. Thank you again.<br>
    > Matt<br>
    > <br>
    > <br>
    > Matt Fearon wrote:<br>
    > <blockquote type="cite" cite="mid3E25B0CE.1030802 AT unh.edu">
    > <meta http-equiv="Content-Type" content="text/html;">
    > <title></title>
    > Mary,<br>
    > <br>
    > Thank you. This is great. Also, would it be possible to customize<br>
    > the colors in the labelbar. I thought this might work;<br>
    > <br>
    > lbres@lbFillColors = (/"yellow","red","blue","black"/)<br>
    > <br>
    > but it does not. How might customize the colors in the labelbar?<br>
    > Do the colors have to come from the gsn_define_colormap?<br>
    > Thank you again for your response.<br>
    > <br>
    > Matt<br>
    > <br>
    > <br>
    > <br>
    > Mary Haley wrote:<br>
    >
    > <blockquote type="cite"
    > cite="mid200301151752.h0FHqPC18127 AT buffy.scd.ucar.edu">
    > <blockquote type="cite">
    > <pre wrap="">matt,
    >
    > you may be missing:
    >
    > res@pmLabelBarDisplayMode = "Always" ; turns on label bar
    > see
    >
    > <a class="moz-txt-link-freetext"
    > href="http://echorock.cgd.ucar.edu/csm/support/CSM_Graphics/Scripts/lb_5.ncl">http://echorock.cgd.ucar.edu/csm/support/CSM_Graphics/Scripts/lb_5.ncl>
    > for my web example of creating a colorbar from scratch
    >
    > </pre>
    > </blockquote>
    >
    > <pre wrap=""><!---->
    > But Matt is using gsn_labelbar_ndc which directly creates a labelbar,
    > so no pm* resources are going to affect his labelbar. The pm* resources
    > only come into effect when you have a labelbar associated with a plot.
    > The URL you gave doesn't create a labelbar from scratch. It uses the
    > labelbar automatically generated by the contour plot, and then it
    > sets some resources to change the look of it.
    >
    > In Matt's case, the reason why the lbPerimOn resource is not working
    > is because you need an "lbres@" in front of it.
    >
    > As for the lbFillPattern resource, if you want solid fill for each
    > box, you need to also set lbMonoFillPattern to True. The default is
    > False, which means it's going to use different fill patterns for each
    > box.
    >
    > Your final resource list might look something like this:
    >
    > lbres = True
    > lbres@lbAutomanage = False
    > lbres@lbLabelFontHeightF = 0.013
    > lbres@vpHeightF = .09
    > lbres@vpWidthF = .5
    > lbres@lbPerimOn = False
    > lbres@lbFillPattern = "SolidFill"
    > lbres@lbMonoFillPattern = True
    >
    > gsn_labelbar_ndc(wks,4,labels,0.4,0.2,lbres)
    >
    > --Mary
    >
    > </pre>
    >
    > <blockquote type="cite">
    > <pre wrap="">On Wed,
    > 15 Jan 2003, Matt Fearon wrote:
    >
    > </pre>
    >
    > <blockquote type="cite">
    > <pre wrap="">Dear NCL users:
    >
    > I am trying to use the gsn_labelbar_ndc procedure to add
    > a labelbar into the viewport. However, I am having trouble
    > modifying the labelbar resources - many of resources are
    > seemingly being ignored, i.e., the resources with asterisks in
    > front are the only ones that seem to be working;
    >
    > *lbres = True
    > lbres@lbAutoManage = False
    > *lbres@lbLabelFontHeightF = 0.013
    > * lbres@vpHeightF = .09
    > *lbres@vpWidthF = .5
    > lbPerimOn = False
    > lbres@lbFillPattern = "SolidFill"
    > gsn_labelbar_ndc(wks,4,labels,0.4,0.2,lbres)
    >
    > Is there a resource I can set that will allow me to custom the labelbar?
    > thank you,
    > Matt
    >
    >
    >
    > _______________________________________________
    > ncl-talk mailing list
    > <a class="moz-txt-link-abbreviated" href="mailto:
    ncl-talk AT ucar.edu">ncl-talk AT ucar.edu</a>
    > <a class="moz-txt-link-freetext"
    > href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
    >
    > </pre>
    > </blockquote>
    >
    > <pre wrap="">
    > ******************************************************
    > Sylvia Murphy EML: <a
    > class="moz-txt-link-abbreviated" href="mailto:
    murphys AT ucar.edu">murphys AT ucar.edu</a>
    > NCAR CGD/CAS PHN: 303-497-1720
    > 3080 Center Green Drive FAX: 303-497-1333
    > Boulder CO 80301
    >
    >
    > WEB: <a class="moz-txt-link-freetext"
    > href="http://www.cgd.ucar.edu/csm/support/">http://www.cgd.ucar.edu/csm/support/>
    > <a class="moz-txt-link-freetext"
    > href="
    http://www.cgd.ucar.edu/csm/support/CSM_Graphics/">http://www.cgd.ucar.edu/csm/support/CSM_Graphics/>
    > ******************************************************
    >
    >
    >
    > _______________________________________________
    > ncl-talk mailing list
    > <a class="moz-txt-link-abbreviated" href="mailto:
    ncl-talk AT ucar.edu">ncl-talk AT ucar.edu</a>
    > <a class="moz-txt-link-freetext"
    > href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
    >
    > </pre>
    > </blockquote>
    >
    > <pre wrap=""><!---->
    > </pre>
    > </blockquote>
    > </blockquote>
    > <br>
    > </body>
    > </html>
    >
    > --------------080803070804020205090708--
    >
    > _______________________________________________
    > ncl-talk mailing list
    >
    ncl-talk AT ucar.edu
    > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
    >

    _______________________________________________
    ncl-talk mailing list
    ncl-talk AT ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk



    This archive was generated by hypermail 2b29 : Wed Jan 15 2003 - 13:54:00 MST