Plot [message #78570] |
Fri, 09 December 2011 07:06  |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
Folks
hi,
I have a data like this and i want to plot column 1 (x) and column 2
(y) and column 3 as the name of the points on plot (like 12006, 12507
etc.). Could somebody help please?
0 0 12006
35 196.7 12507
70 779.8 13008
140 37 14010
.............
Cheers,
Dave
|
|
|
|
Re: Plot [message #78753 is a reply to message #78570] |
Fri, 09 December 2011 08:58   |
Mark Piper
Messages: 198 Registered: December 2009
|
Senior Member |
|
|
On 12/9/2011 8:06 AM, Dave Poreh wrote:
> Folks
> hi,
> I have a data like this and i want to plot column 1 (x) and column 2
> (y) and column 3 as the name of the points on plot (like 12006, 12507
> etc.). Could somebody help please?
>
> 0 0 12006
> 35 196.7 12507
> 70 779.8 13008
> 140 37 14010
> .............
> Cheers,
> Dave
Would this be close?
x = [0, 35, 70, 140]
y = [0, 196.7, 779.8, 37]
s = string([12006, 12507, 13008, 14010])
; NG (IDL 8.1)
p = plot(x, y)
ps = symbol(x, y, sym_text=s, /data)
; DG (IDL 1.0)
plot, x, y
xyouts, x, y, s, alignment=0.5, /data
You'll likely have to tweak the axis ranges to ensure the labels show up.
mp
.
|
|
|
Re: Plot [message #84643 is a reply to message #78752] |
Sat, 10 December 2011 06:04  |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Dec 9, 4:11 pm, Jeremy Bailin <astroco...@gmail.com> wrote:
> On 12/9/11 3:06 PM, Dave Poreh wrote:
>
>> Folks
>> hi,
>> I have a data like this and i want to plot column 1 (x) and column 2
>> (y) and column 3 as the name of the points on plot (like 12006, 12507
>> etc.). Could somebody help please?
>
>> 0 0 12006
>> 35 196.7 12507
>> 70 779.8 13008
>> 140 37 14010
>> .............
>> Cheers,
>> Dave
>
> Try using XYOUTS.
>
> -Jeremy.
>
> .
Mark, when i am running it gives me this error:
ps = symbol(x, y, sym_text=s, /data)
but still i have the plot.
Cheers,
Dave
^
% Syntax error.
|
|
|