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

Home » Public Forums » archive » Labeling Lines of 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
Labeling Lines of Data [message #93090] Tue, 26 April 2016 06:27 Go to next message
Ali Gamal is currently offline  Ali Gamal
Messages: 98
Registered: June 2013
Member
Hi,

I have IDL program as
******************************
file='/home/1.out'
openr,1,file
nh=50
falc=fltarr(11,nh)
readf,1,falc
tau5000=falc(0,*)
dep1=falc(1,*)
dep2=falc(2,*)
dep3=falc(3,*)
dep4=falc(4,*)
dep5=falc(5,*)
dep6=falc(6,*)
dep7=falc(7,*)
dep8=falc(8,*)
dep9=falc(9,*)
dep10=falc(10,*)

cgPLOT, tau5000, dep1,xrange=[-4.9,0.85],yrange=[-1.5,0.8],Thick=2,xstyle=2

plots,1,1,/continue
OPLOT,tau5000,dep2,linestyle=0 ;2
OPLOT,tau5000,dep3,linestyle=0 ;3
OPLOT,tau5000,dep4,linestyle=0 ;4
OPLOT,tau5000,dep5,linestyle=0 ;5
OPLOT,tau5000,dep6,linestyle=0 ;6
OPLOT,tau5000,dep7,linestyle=0 ;7
OPLOT,tau5000,dep8,linestyle=0 ;8
OPLOT,tau5000,dep9,linestyle=0 ;9
OPLOT,tau5000,dep10,linestyle=0 ;10
**********************************************
I want to label dep1, 2, 3 and so on as 'dep1', 'dep2'

How can I do it
Re: Labeling Lines of Data [message #93092 is a reply to message #93090] Tue, 26 April 2016 09:32 Go to previous messageGo to next message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
First, two pieces of advice to avoid future troubles.

1. Don't subscript with parentheses but use square brackets tau5000=falc[0,*]
Parentheses were deprecated starting in 1997.

2. Don't mix Coyote graphics and standard graphics. If you use cgPLOT then also use cgOPLOT

Use CGTEXT to label your lines. You can either supply the X,Y coordinates where you want the label to appear, or use the /PLACE keyword to interactively place them with your cursor.

On Tuesday, April 26, 2016 at 9:27:31 AM UTC-4, Ali Gamal wrote:
> Hi,
>
> I have IDL program as
> ******************************
> file='/home/1.out'
> openr,1,file
> nh=50
> falc=fltarr(11,nh)
> readf,1,falc
> tau5000=falc(0,*)
> dep1=falc(1,*)
> dep2=falc(2,*)
> dep3=falc(3,*)
> dep4=falc(4,*)
> dep5=falc(5,*)
> dep6=falc(6,*)
> dep7=falc(7,*)
> dep8=falc(8,*)
> dep9=falc(9,*)
> dep10=falc(10,*)
>
> cgPLOT, tau5000, dep1,xrange=[-4.9,0.85],yrange=[-1.5,0.8],Thick=2,xstyle=2
>
> plots,1,1,/continue
> OPLOT,tau5000,dep2,linestyle=0 ;2
> OPLOT,tau5000,dep3,linestyle=0 ;3
> OPLOT,tau5000,dep4,linestyle=0 ;4
> OPLOT,tau5000,dep5,linestyle=0 ;5
> OPLOT,tau5000,dep6,linestyle=0 ;6
> OPLOT,tau5000,dep7,linestyle=0 ;7
> OPLOT,tau5000,dep8,linestyle=0 ;8
> OPLOT,tau5000,dep9,linestyle=0 ;9
> OPLOT,tau5000,dep10,linestyle=0 ;10
> **********************************************
> I want to label dep1, 2, 3 and so on as 'dep1', 'dep2'
>
> How can I do it
Re: Labeling Lines of Data [message #93096 is a reply to message #93090] Tue, 26 April 2016 11:48 Go to previous messageGo to next message
Ali Gamal is currently offline  Ali Gamal
Messages: 98
Registered: June 2013
Member
On Tuesday, April 26, 2016 at 3:27:31 PM UTC+2, Ali Gamal wrote:
> Hi,
>
> I have IDL program as
> ******************************
> file='/home/1.out'
> openr,1,file
> nh=50
> falc=fltarr(11,nh)
> readf,1,falc
> tau5000=falc(0,*)
> dep1=falc(1,*)
> dep2=falc(2,*)
> dep3=falc(3,*)
> dep4=falc(4,*)
> dep5=falc(5,*)
> dep6=falc(6,*)
> dep7=falc(7,*)
> dep8=falc(8,*)
> dep9=falc(9,*)
> dep10=falc(10,*)
>
> cgPLOT, tau5000, dep1,xrange=[-4.9,0.85],yrange=[-1.5,0.8],Thick=2,xstyle=2
>
> plots,1,1,/continue
> OPLOT,tau5000,dep2,linestyle=0 ;2
> OPLOT,tau5000,dep3,linestyle=0 ;3
> OPLOT,tau5000,dep4,linestyle=0 ;4
> OPLOT,tau5000,dep5,linestyle=0 ;5
> OPLOT,tau5000,dep6,linestyle=0 ;6
> OPLOT,tau5000,dep7,linestyle=0 ;7
> OPLOT,tau5000,dep8,linestyle=0 ;8
> OPLOT,tau5000,dep9,linestyle=0 ;9
> OPLOT,tau5000,dep10,linestyle=0 ;10
> **********************************************
> I want to label dep1, 2, 3 and so on as 'dep1', 'dep2'
>
> How can I do it

Thanks a lot, I want to make my program determine X, Y at end of each plot, How can I do It ?
I tried to make y=dep1 ot 2 but it did not work correctly
Re: Labeling Lines of Data [message #93110 is a reply to message #93096] Thu, 28 April 2016 10:32 Go to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Tuesday, April 26, 2016 at 1:48:23 PM UTC-5, Ali Gamal wrote:
> On Tuesday, April 26, 2016 at 3:27:31 PM UTC+2, Ali Gamal wrote:
>> Hi,
>>
>> I have IDL program as
>> ******************************
>> file='/home/1.out'
>> openr,1,file
>> nh=50
>> falc=fltarr(11,nh)
>> readf,1,falc
>> tau5000=falc(0,*)
>> dep1=falc(1,*)
>> dep2=falc(2,*)
>> dep3=falc(3,*)
>> dep4=falc(4,*)
>> dep5=falc(5,*)
>> dep6=falc(6,*)
>> dep7=falc(7,*)
>> dep8=falc(8,*)
>> dep9=falc(9,*)
>> dep10=falc(10,*)
>>
>> cgPLOT, tau5000, dep1,xrange=[-4.9,0.85],yrange=[-1.5,0.8],Thick=2,xstyle=2
>>
>> plots,1,1,/continue
>> OPLOT,tau5000,dep2,linestyle=0 ;2
>> OPLOT,tau5000,dep3,linestyle=0 ;3
>> OPLOT,tau5000,dep4,linestyle=0 ;4
>> OPLOT,tau5000,dep5,linestyle=0 ;5
>> OPLOT,tau5000,dep6,linestyle=0 ;6
>> OPLOT,tau5000,dep7,linestyle=0 ;7
>> OPLOT,tau5000,dep8,linestyle=0 ;8
>> OPLOT,tau5000,dep9,linestyle=0 ;9
>> OPLOT,tau5000,dep10,linestyle=0 ;10
>> **********************************************
>> I want to label dep1, 2, 3 and so on as 'dep1', 'dep2'
>>
>> How can I do it
>
> Thanks a lot, I want to make my program determine X, Y at end of each plot, How can I do It ?
> I tried to make y=dep1 ot 2 but it did not work correctly

If you just mean the last value, then you can use
y = dep1[N_ELEMENTS(dep1)-1]

-Jeremy.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: cgHistoplot over plot
Next Topic: syntax for calling parent class _overloadPlus method

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

Current Time: Wed Oct 08 11:27:13 PDT 2025

Total time taken to generate the page: 0.00511 seconds