Re: Changing colors within a text string.

From: David Bailey <dbailey_at_nyahnyahspammersnyahnyah>
Date: Wed, 31 May 2006 10:42:37 -0600 (MDT)

Hi Mary,

Yeah, I decided to do it the "hard" way. Scott Weese had coded up
something to do it this way. For those who are curious:

     txres = True
     txres@txFontHeightF = 19
     txres@txFontColor = "blue"
     gsn_text_ndc(wks,case_name,0.75,0.878,txres)

     txres = True
     txres@txFontHeightF = 19
     txres@txFontColor = "red"
     gsn_text_ndc(wks,comp_name,0.30,0.878,txres)

This places the two pieces of text just above the plots to the left and
right.

Dave

On Wed, 31 May 2006, Mary Haley wrote:

> Hi Dave,
>
> For a long time I had convinced myself that there was a function code
> that allowed you to change the text string color in the middle of a
> string. I'm not sure why I convinced myself of this, but it doesn't
> exist unfortunately. In order to create strings of different colors,
> you will need to call gsn_text for each different-colored string and
> use the txColor resource to change the color.
>
> Meanwhile, I will ask the developers if there's a way we could have
> a function code implemented to do this.
>
> --Mary
>
>
> On Tue, 30 May 2006, David Bailey wrote:
>
>> Hi there,
>>
>> I searched the documentation, but was unable to find an answer to this.
>> Does anyone know of a way to specify different colors within a text string?
>>
>> Something like:
>>
>> res@txFuncCode = "~"
>> res@txString = "~Red~Case 1 ~Blue~Case 2"
>>
>> would be great.
>>
>> Dave
>>
>> --
>> David A Bailey email: dbailey_at_ucar.edu
>> National Center for Atmospheric Research phone: 303-497-1737
>> PO Box 3000 fax : 303-497-1700
>> Boulder, CO 80307-3000
>> http://www.cgd.ucar.edu/oce/dbailey
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk_at_ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>

-- 
David A Bailey                             email: dbailey_at_ucar.edu
National Center for Atmospheric Research   phone: 303-497-1737
PO Box 3000                                fax  : 303-497-1700
Boulder, CO 80307-3000
              http://www.cgd.ucar.edu/oce/dbailey
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed May 31 2006 - 10:42:37 MDT

This archive was generated by hypermail 2.2.0 : Wed May 31 2006 - 12:09:10 MDT