[Thread Prev][Thread Next][Index]

Re: embedding color in a title using @Cnnn syntax



Hi all,
Thanks Andrew for your answer - We have the problem with
<NL> and @Cnnn on our bug list and we do intend to fix it,
but it's great to have a workaround in the meantime.  The
issues about the ASCII font came up last week, and are I hope
addressed by the conversation on the list about using the
ASCII font and special-character fonts.  That thread starts
with this message
http://www.ferret.noaa.gov/Ferret/Mail_Archives/fu_2003/msg01551.html
and the answer is to include the escape character in label
strings, as outlined in this FAQ,
"How can I change fonts (or use a special PPLUS character)
once I've changed to ASCII font?" at
http://www.ferret.noaa.gov/Ferret/FAQ/custom_labels/ascii_fonts.html


Andrew Wittenberg wrote:
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