comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Color Fonts?!?!?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Color Fonts?!?!? [message #30299 is a reply to message #30298] Wed, 17 April 2002 12:13 Go to previous messageGo to previous message
Ken Mankoff is currently offline  Ken Mankoff
Messages: 158
Registered: February 2000
Senior Member
> Date: Wed, 17 Apr 2002 12:26:45 -0600
> From: Sean Davis <sdavis@nis.lanl.gov>
> Does anyone know how to make a string have different colored fonts. I
> would like the x-axis title on a plot to have a string that has different
> colors. thanks!

OK, after re-reading your post, it seems like you really do want each
letter to be a different color in the same string (weird!). In order
to do this via the method I showed in my last post, you need to use
fixed-width fonts OR somehow get plot to accept an "ALIGN=0.0" call.
If you can do either of these, it is simple to adapt the code below to
a loop of PLOT calls, with xtitle= being the key part.

If you want to do it in your normal font, you have to use XYOUTS, and
position the string in the correct location yourself. But here is how
to get a rainbow string:

data = indgen(10)
title = 'This is a Title'
plot, data
for i=15, 0, -1 do $
xyouts, 0.5, 0.5, align=0.0, /norm, $
strmid(title,0,i)+strmid(' ',i,15), $
color=255-(i*12), chars=2

This is getting closer to the "extraordinary hack" that David
mentioned (as in "extraordinary ugly").

-k.
--
------------------------------------------------------------ ---------------
Ken Mankoff http://lasp.colorado.edu/snoe/
http://lasp.colorado.edu/mars/
http://lasp.colorado.edu/~mankoff/ http://lasp.colorado.edu/marsrobot/
------------------------------------------------------------ ---------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Help me aviod a FOR loop!?!?
Next Topic: 24-bit color problem on Red Hat Linux 7.1

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 02:26:48 PDT 2025

Total time taken to generate the page: 0.16446 seconds