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

Home » Public Forums » archive » Re: Re : Color Fonts?!?!?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Re : Color Fonts?!?!? [message #31844] Wed, 21 August 2002 19:24
rmw092001 is currently offline  rmw092001
Messages: 17
Registered: January 2002
Junior Member
Reimar Bauer <R.Bauer@fz-juelich.de> wrote in message news:<ajv9o8$emlc$1@zam602.zam.kfa-juelich.de>...
> RichardW wrote:
>
> Dear Richard,
>
> there where much more posting about this. And you can write yourself
> a small procdure to make it easier.
>
> Number 15 from 2002-Apr-23
>
> tek_color
> text=['Dies',' ist',' ein',' Test']
> xyouts,0.5,0.5,text,color=[0,5,2,3,4]
>
> You need as much blanks as letters for each word.
> This could be done by strlen.

I forgot xyouts can use text arrays...
How about -

loadct,33
a=['Dies','ist','ein','Test']
xyouts,.1,.5,'.',charsize=-1 ; move the 'cursor', don't write anything
xyouts,a+' ',color=findgen(4)*80

it saves having to count the blank spaces :-)

>
> This is the address of the complete thread
> http://groups.google.de/groups?hl=de&lr=&ie=UTF-8&am p;frame=right&th=a6e4907a12108490&seekm=Pine.LNX.4.3 3.0204171221180.1744-100000%40vglass.lanl.gov#link1
>
>
>> Hello,
>> I wanted to plot a string with words in different colors, and found
>> this thread from a few months ago (unfortunately google doesn't allow
>> to restart old newsgroup threads).
>
> Describe your statement a bit more. What did you mean by google doesn't
> allow to restart old newsgroup threads?
>
> I am able to read articles from 1991 (more than 10 years)
> http://groups.google.de/groups?hl=de&lr=&ie=UTF-8&am p;threadm=271%40locke.water.ca.gov&rnum=61&prev=/gro ups%3Fq%3D1991%2Bgroup:comp.lang.idl-pvwave%26start%3D60%26h l%3Dde%26lr%3D%26ie%3DUTF-8%26selm%3D271%2540locke.water.ca. gov%26rnum%3D61
>

The option 'Post a follow-up to this message' disappears after a few months(?)
I can read the link above but not reply

> regards
>
> Reimar
>
>> But isn't there a much easier way -
>> loadct,33
>> a=['the',' quick',' brown',' fox',' jumped',' over',' the',' lazy','
>> dog']
>> xyouts,.1,.5,a(0),color=20
>> for i=1,8 do xyouts,a(i),color=20+i*25
>>
>> where XYOUTS remembers the last position if you don't give it x,y
>> values???? Anyway, just posting this so it's archived on google, in
>> case it's useful
>>
>> RW
>> =====
Re: Re : Color Fonts?!?!? [message #31861 is a reply to message #31844] Tue, 20 August 2002 22:50 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
RichardW wrote:

Dear Richard,

there where much more posting about this. And you can write yourself
a small procdure to make it easier.

Number 15 from 2002-Apr-23

tek_color
text=['Dies',' ist',' ein',' Test']
xyouts,0.5,0.5,text,color=[0,5,2,3,4]

You need as much blanks as letters for each word.
This could be done by strlen.

This is the address of the complete thread
http://groups.google.de/groups?hl=de&lr=&ie=UTF-8&am p;frame=right&th=a6e4907a12108490&seekm=Pine.LNX.4.3 3.0204171221180.1744-100000%40vglass.lanl.gov#link1


> Hello,
> I wanted to plot a string with words in different colors, and found
> this thread from a few months ago (unfortunately google doesn't allow
> to restart old newsgroup threads).

Describe your statement a bit more. What did you mean by google doesn't
allow to restart old newsgroup threads?

I am able to read articles from 1991 (more than 10 years)
http://groups.google.de/groups?hl=de&lr=&ie=UTF-8&am p;threadm=271%40locke.water.ca.gov&rnum=61&prev=/gro ups%3Fq%3D1991%2Bgroup:comp.lang.idl-pvwave%26start%3D60%26h l%3Dde%26lr%3D%26ie%3DUTF-8%26selm%3D271%2540locke.water.ca. gov%26rnum%3D61

regards

Reimar

> But isn't there a much easier way -
> loadct,33
> a=['the',' quick',' brown',' fox',' jumped',' over',' the',' lazy','
> dog']
> xyouts,.1,.5,a(0),color=20
> for i=1,8 do xyouts,a(i),color=20+i*25
>
> where XYOUTS remembers the last position if you don't give it x,y
> values???? Anyway, just posting this so it's archived on google, in
> case it's useful
>
> RW
> =====
> Subject: Re: Color Fonts?!?!?
> Date: 2002-04-17 12:20:13 PST
>
>> 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").

--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: enscript (formatted color printing)
Next Topic: Re: From a novice in IDL

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

Current Time: Fri Oct 10 13:47:56 PDT 2025

Total time taken to generate the page: 0.96058 seconds