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

Home » Public Forums » archive » plot String data
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
plot String data [message #93140] Sun, 01 May 2016 10:56 Go to next message
Ali Gamal is currently offline  Ali Gamal
Messages: 98
Registered: June 2013
Member
hi,
I have string data and normal data , I want to plot this data as X axis string data and Y x with normal data.
;;;;;;;;;;;;;;;;;;;;;;;;;;;
openr,1,'/home/a.txt'
a=strarr(49)
readf,1,a
openr,2,'/home/b.dat'
b=fltarr(49)
readf,2,b
plot,a,b
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;
but it is not true.
Re: plot String data [message #93142 is a reply to message #93140] Mon, 02 May 2016 07:27 Go to previous messageGo to next message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
So you have a string array X = ['lions','tigers','bears'] and you want to plot Y versus X. I don't think so.

It is possible you want to make a box plot with the X axis labeled with strings.
You can find examples of how to do this in the PLOT help page

http://www.harrisgeospatial.com/docs/PLOT_Procedure.html

or on David Fanning's plot gallery

http://www.idlcoyote.com/gallery/



On Sunday, May 1, 2016 at 1:56:34 PM UTC-4, AGW wrote:
> hi,
> I have string data and normal data , I want to plot this data as X axis string data and Y x with normal data.
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;
> openr,1,'/home/a.txt'
> a=strarr(49)
> readf,1,a
> openr,2,'/home/b.dat'
> b=fltarr(49)
> readf,2,b
> plot,a,b
> end
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;
> but it is not true.
Re: plot String data [message #93144 is a reply to message #93140] Mon, 02 May 2016 13:31 Go to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Sunday, May 1, 2016 at 6:56:34 PM UTC+1, AGW wrote:
> hi,
> I have string data and normal data , I want to plot this data as X axis string data and Y x with normal data.
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;
> openr,1,'/home/a.txt'
> a=strarr(49)
> readf,1,a
> openr,2,'/home/b.dat'
> b=fltarr(49)
> readf,2,b
> plot,a,b
> end
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;
> but it is not true.

I did this sort of thing using function graphics. In my case, I did a histogram of the frequency with which certain words appeared. I then sorted the words according to their frequency and plotted this in a barplot type histogram. This works however also for a simple plot().
Basically it is something like this:

xx = findgen(10)
yy = findgen(10)
pp = plot(xx,yy)
pp['xaxis'].tickInterval = 1
tn = pp['xaxis'].tickname
for i=0,9 do tn[i]=string(byte(i)+97b)
tn[10] = ''
pp['xaxis'].tickname = tn

Something like this was shown a few days ago on the newsgroup and I found it really nice. I think it was Pablo P.

Cheers,
Helder
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Can i use CONTOUR to retrieve the subscripts within a closed contour?
Next Topic: Very basic IDL vector question

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

Current Time: Wed Oct 08 11:33:28 PDT 2025

Total time taken to generate the page: 0.00576 seconds