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

Home » Public Forums » archive » Re: Adding Text/Equations to Plots
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: Adding Text/Equations to Plots [message #65698] Mon, 16 March 2009 12:54 Go to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
doh, I hate when I receive the other poster messages 1/2 hour late...

so, sorry for the repetition..

Jean H. wrote:
> Heather wrote:
>
>> IDL> numbers=findgen(10)
>> IDL> string="This is a number: numbers(6)"
>> IDL> print, string
>> This is a number: numbers(6)
>
>> Any advice would be greatly appreciated, but I'm fairly new to the
>> world of IDL, so please use "simple" explanations!
>> Thanks,
>> Heather
>
> Heather,
> You can do string concatenation and conversion
>
> print, "this is a number " + string(numbers[6])
>
> you can also have more control... remove the blanks:
>
> print, "this is a number " + strtrim(numbers[6],2)
>
> or even add formats:
> print, "this is a number " + string(numbers[6],format = '(I)')
>
> and with no blanks
>
> print, "this is a number " + strtrim(string(numbers[6],format = '(I)'),2)
>
> Jean
> PS: replace print, by text = if you want to save the string
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Adding Text/Equations to Plots
Next Topic: Using contour in postscripts produces a "stripe" effect?

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

Current Time: Thu Oct 09 06:03:27 PDT 2025

Total time taken to generate the page: 0.00476 seconds