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 #65701 is a reply to message #65698] Mon, 16 March 2009 12:45 Go to previous messageGo to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
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: Sat Oct 11 05:13:50 PDT 2025

Total time taken to generate the page: 1.27956 seconds