[Thread Prev][Thread Next][Index]

Re: embedding color in a title using @Cnnn syntax



On Mon, 4 Oct 2004, Steve Knox wrote:
> I'm trying to use the "@Cnnn" syntax to embed different colors in a plot 
> title.
> 
> let t1="@C000line 1<NL> @C002line 2 @C003rest of line"
> plot/symbol/line/title="`t1`" tmx,ghcn_tmax,ghcn_tmax-tmx
>  !-> plot/symbol/line/title="@C000line 1<NL> @C002line 2 @C003rest of 
> line" tmx,ghcn_tmax,ghcn_tmax-tmx
> 
> The title that is produced has the text "line 1" in black but the text 
> "line 2" is "C002line 2" in color black The text "rest of line" is 
> green, which is correct. Why isn't the color of "line 2" getting set to 
> "red"? It seems to be dropping the "@" and thus not interpreting the 
> @C002. If I drop the newline symbol "<nl>" it works.

Hi Steve,

The 1-digit color-change command (@Pn) seems to work fine, as do most of
the font-change commands (@SG, etc.).  But the ASCII simplex (@AS) font
causes some problems, and @Cnnn seems to get ignored after the first <NL>.  
By a stroke of luck, I discovered that one can prevent this by putting a
"closing @C" before the next color change. Here are some examples:

plot/hl=0:1/vl=0:1/vs 0,0
label .2 .7 0 0 .3 "@P2This<NL>@P3works<NL>@P4fine."
label .5 .7 0 0 .3 "@C002This<NL>@C003does<NL>@C004not."
label .8 .7 0 0 .3 "@C002This<NL>@C@C003fixes<NL>@C@C004it\!"
label .2 .3 0 0 .3 "Greek<NL>@SGt@SR_y<NL>works."
label .7 .3 0 0 .3 "@ASASCII @P2simplex<NL>@P3has @P4some<NL>problems."

Cheers,

Andrew




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement