Re: adding symbols

From: Mary Haley (haley AT XXXXXX)
Date: Tue Jun 24 2003 - 10:54:08 MDT

  • Next message: Louis J. Wicker: "Problem running defined fortran libs"

    >
    > dear ncl users:
    >
    > just wondering how to add a symbol as text to a plot.
    > i would like to add the symbol for potential temperature
    > (theta). could i do this using function codes somehow?
    > thank you,
    > matt
    >

    Hi Matt,

    Yes, any time you want to add a special symbol to a plot, you
    can usually do this via a text function code. First, visit the
    NCL font tables at:

       http://ngwww.ucar.edu/ngdoc/ng/ref/FontTable.html

    You can click on any one of the font names or numbers to see all the
    characters for that font. If you see one you like, keep track of which
    character it is associated with. I'm going to use the infinity symbol
    as an example (font table 34, character "%"):

    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"

    begin
       wks = gsn_open_wks("x11","example")

       inf_sym = ":F34:%"

       gsn_text_ndc(wks,inf_sym,0.5,0.5,False)
       frame(wks)
    end

    Note that the colon (:) in the string ":F34:%" tells NCL that you are
    about to enter a function code, which is "F34" in this case. This
    tells NCL to start using font table 34. The second colon takes you out
    of function code mode, and back into regular mode. Then, when the "%"
    is encountered, you will get whatever character this represents in
    font table 34 (an infinity symbol).

    Some people may have redefined the function code to be another
    character (like a tilde (~)), in which case you will need to use this
    character in place of the colons.

    You can see some examples at:

        http://www.cgd.ucar.edu/csm/support/CSM_Graphics/text.shtml

    --Mary

    -------------------------------------------------
    Mary Haley haley AT ucar.edu
    NCAR/SCD/VETS 303-497-1254 (voice)
    1850 Table Mesa Dr 303-497-1804 (fax)
    Boulder, CO 80305
    -------------------------------------------------
    _______________________________________________
    ncl-talk mailing list
    ncl-talk AT ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk



    This archive was generated by hypermail 2b29 : Tue Jun 24 2003 - 13:16:59 MDT