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

Home » Public Forums » archive » Trying to create a plot with strings as x-values...
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: Trying to create a plot with strings as x-values... [message #88315 is a reply to message #88314] Sun, 13 April 2014 21:13 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
doowstados@gmail.com writes:

> Please forgive my poor IDL background. Hopefully you IDL experts can help me out.
>
> I'm attempting to create a plot with strings as x values.
>
> I have two lists being loaded from text files in this format:
>
> xlist = list(value1, value1, value1, value2, value2, value3, ..., valueN)
>
> ylist = list(12, 17, 15, 13, 11.4, 19, 17, ..., numN)
>
> These lists are fairly short, maybe 150-200 coordinate pairs total, but only around 50 unique strings in the xlist, so the program doesn't need to be particularly resource efficient.
>
>
> IDL's plot function and cgPlot don't seem to get along well with strings.

I presume these "strings" are numbers. Something like '5.2' or '3.4'. If
so, just cast them to floats before you plot them.

IDL> value = '5.3'
IDL> Help, float(value)
<Expression> FLOAT = 5.30000

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Contour value in each point in XY plane
Next Topic: BarCoords- cgBarplot

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

Current Time: Wed Oct 08 18:32:04 PDT 2025

Total time taken to generate the page: 0.00260 seconds