CONTOUR problem

This is a discussion on CONTOUR problem within the Idl-pvwave forums in Programming Languages category; HI~ everyone~ i use the contour pro to display a 2Darray named s11. And I wrote it like this: CONTOUR,s11,rangle,vangle,xrange=[0,180],yrange=[0,90],ytitle='Viewing zenith angle',xtitle='Relative azimuth angle',/C_LABELS But the xrange and yrange do not work and it only labeled on line in the image , Any one see where the problem is ? Thank you very much~ The whole program is like this if u want to see it: rangle=findgen(180) vangle=findgen(90) y1=rangle*3.1415926*2/360 y2=vangle*3.1415926*2/360 ;plot,y thta1=22.5*3.1415926*2/360 thta2=37.5*3.1415926*2/360 thta3=52.5*3.1415926*2/360 thta4=67.5*3.1415926*2/360 ;print,sin(thta2) r1=fltarr(180,90) r2=fltarr(180,90) r3=fltarr(180,90) r4=fltarr(180,90) x10=sin(thta1)*cos(y1) x20=sin(y1)*cos(y2) y10=sin(thta1)*sin(y1) y20=sin(y1)*sin(y2) x11=sin(thta1)*cos(y1) x21=sin(y1)*cos(y2) y11=sin(thta1)*sin(y1) y21=sin(y1)*sin(y2) x12=sin(thta1)*cos(y1) x22=sin(y1)*cos(y2) y12=sin(thta1)*sin(y1) y22=sin(y1)*sin(y2) x13=sin(thta1)*cos(y1) x23=sin(y1)*cos(y2) y13=sin(thta1)*sin(y1) y23=sin(y1)*sin(y2) for i=0,179 do begin ...

Go Back   Application Development Forum > Programming Languages > Idl-pvwave

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-26-2008, 07:21 PM
xiao
Guest
 
Default CONTOUR problem

HI~ everyone~ i use the contour pro to display a 2Darray named s11.
And I wrote it like this:

CONTOUR,s11,rangle,vangle,xrange=[0,180],yrange=[0,90],ytitle='Viewing
zenith angle',xtitle='Relative azimuth angle',/C_LABELS

But the xrange and yrange do not work and it only labeled on line in
the image , Any one see where the problem is ?

Thank you very much~

The whole program is like this if u want to see it:

rangle=findgen(180)
vangle=findgen(90)
y1=rangle*3.1415926*2/360
y2=vangle*3.1415926*2/360
;plot,y
thta1=22.5*3.1415926*2/360
thta2=37.5*3.1415926*2/360
thta3=52.5*3.1415926*2/360
thta4=67.5*3.1415926*2/360

;print,sin(thta2)

r1=fltarr(180,90)
r2=fltarr(180,90)
r3=fltarr(180,90)
r4=fltarr(180,90)

x10=sin(thta1)*cos(y1)
x20=sin(y1)*cos(y2)
y10=sin(thta1)*sin(y1)
y20=sin(y1)*sin(y2)

x11=sin(thta1)*cos(y1)
x21=sin(y1)*cos(y2)
y11=sin(thta1)*sin(y1)
y21=sin(y1)*sin(y2)

x12=sin(thta1)*cos(y1)
x22=sin(y1)*cos(y2)
y12=sin(thta1)*sin(y1)
y22=sin(y1)*sin(y2)

x13=sin(thta1)*cos(y1)
x23=sin(y1)*cos(y2)
y13=sin(thta1)*sin(y1)
y23=sin(y1)*sin(y2)

for i=0,179 do begin
for j=0,89 do begin
r1(i,j)=x10(i)*x20(j)+y10(i)*y20(j)+cos(y20(j))*co s(thta1)
r2(i,j)=x11(i)*x21(j)+y11(i)*y21(j)+cos(y21(j))*co s(thta2)
r3(i,j)=x12(i)*x22(j)+y12(i)*y22(j)+cos(y22(j))*co s(thta3)
r4(i,j)=x13(i)*x23(j)+y13(i)*y23(j)+cos(y23(j))*co s(thta4)

endfor
endfor
help,r1

s1=acos(r1)*360/2/3.1415926
s2=acos(r2)*360/2/3.1415926
s3=acos(r3)*360/2/3.1415926
s4=acos(r4)*360/2/3.1415926

;print,acos(r1)*360/2/3.1415926
s11=180-s1
s22=180-s2
s33=180-s3
s44=180-s4

;help,x1
;print,s1
!P.background=255
!P.multi=[0,2,2]

CONTOUR,s11,rangle,vangle,xrange=[0,180],yrange=[0,90],ytitle='Viewing
zenith angle',xtitle='Relative azimuth angle',/C_LABELS
CONTOUR,s22,rangle,vangle,xrange=[0,180],yrange=[0,90],ytitle='Viewing
zenith angle',xtitle='Relative azimuth angle',/C_LABELS
CONTOUR,s33,rangle,vangle,xrange=[0,180],yrange=[0,90],ytitle='Viewing
zenith angle',xtitle='Relative azimuth angle',/C_LABELS
CONTOUR,s44,rangle,vangle,xrange=[0,180],yrange=[0,90],ytitle='Viewing
zenith angle',xtitle='Relative azimuth angle',/C_LABELS

end


Reply With Quote
  #2  
Old 08-27-2008, 04:06 AM
Wox
Guest
 
Default Re: CONTOUR problem

On Tue, 26 Aug 2008 16:21:05 -0700 (PDT), xiao <littledddna@gmail.com>
wrote:

>HI~ everyone~ i use the contour pro to display a 2Darray named s11.
>And I wrote it like this:
>
>CONTOUR,s11,rangle,vangle,xrange=[0,180],yrange=[0,90],ytitle='Viewing
>zenith angle',xtitle='Relative azimuth angle',/C_LABELS
>
>But the xrange and yrange do not work and it only labeled on line in
>the image , Any one see where the problem is ?
>
>Thank you very much~


nlevels=5
CONTOUR,s11,rangle,vangle,xrange=[0,180],yrange=[0,90],xstyle=1,ystyle=1,ytitle='Viewing
zenith angle',xtitle='Relative azimuth
angle',C_LABELS=replicate(1,nlevels)

To know how many levels there are (nlevels), you must set the LEVELS
keyword yourself., otherwise make nlevels big enough.
Reply With Quote
  #3  
Old 08-27-2008, 10:02 AM
xiao
Guest
 
Default Re: CONTOUR problem

On Aug 27, 3:06 am, Wox <nom...@hotmail.com> wrote:
> On Tue, 26 Aug 2008 16:21:05 -0700 (PDT), xiao <littledd...@gmail.com>
> wrote:
>
> >HI~ everyone~ i use the contour pro to display a 2Darray named s11.
> >And I wrote it like this:

>
> >CONTOUR,s11,rangle,vangle,xrange=[0,180],yrange=[0,90],ytitle='Viewing
> >zenith angle',xtitle='Relative azimuth angle',/C_LABELS

>
> >But the xrange and yrange do not work and it only labeled on line in
> >the image , Any one see where the problem is ?

>
> >Thank you very much~

>
> nlevels=5
> CONTOUR,s11,rangle,vangle,xrange=[0,180],yrange=[0,90],xstyle=1,ystyle=1,ytitle='Viewing
> zenith angle',xtitle='Relative azimuth
> angle',C_LABELS=replicate(1,nlevels)
>
> To know how many levels there are (nlevels), you must set the LEVELS
> keyword yourself., otherwise make nlevels big enough.


Thanks , it works. but the xrange still does not work......
Reply With Quote
  #4  
Old 08-27-2008, 10:09 AM
xiao
Guest
 
Default Re: CONTOUR problem

On Aug 27, 9:02 am, xiao <littledd...@gmail.com> wrote:
> On Aug 27, 3:06 am, Wox <nom...@hotmail.com> wrote:
>
>
>
> > On Tue, 26 Aug 2008 16:21:05 -0700 (PDT), xiao <littledd...@gmail.com>
> > wrote:

>
> > >HI~ everyone~ i use the contour pro to display a 2Darray named s11.
> > >And I wrote it like this:

>
> > >CONTOUR,s11,rangle,vangle,xrange=[0,180],yrange=[0,90],ytitle='Viewing
> > >zenith angle',xtitle='Relative azimuth angle',/C_LABELS

>
> > >But the xrange and yrange do not work and it only labeled on line in
> > >the image , Any one see where the problem is ?

>
> > >Thank you very much~

>
> > nlevels=5
> > CONTOUR,s11,rangle,vangle,xrange=[0,180],yrange=[0,90],xstyle=1,ystyle=1,ytitle='Viewing
> > zenith angle',xtitle='Relative azimuth
> > angle',C_LABELS=replicate(1,nlevels)

>
> > To know how many levels there are (nlevels), you must set the LEVELS
> > keyword yourself., otherwise make nlevels big enough.

>
> Thanks , it works. but the xrange still does not work......


Btw, how can I set the intervals of the contour ?
thanx
Reply With Quote
  #5  
Old 08-27-2008, 10:13 AM
David Fanning
Guest
 
Default Re: CONTOUR problem

xiao writes:

> Thanks , it works. but the xrange still does not work......


Set the [XY]Style keywords to 1 to force exact axis scaling.
This is, IMHO, almost always necessary when using the CONTOUR
command. You can find more information about the anemic
CONTOUR command here:

http://www.dfanning.com/documents/tips.html#Graphics2d

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Reply With Quote
  #6  
Old 08-27-2008, 10:14 AM
David Fanning
Guest
 
Default Re: CONTOUR problem

xiao writes:

> Btw, how can I set the intervals of the contour ?


http://www.dfanning.com/tips/nlevels.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Reply With Quote
  #7  
Old 08-27-2008, 10:16 AM
xiao
Guest
 
Default Re: CONTOUR problem

On Aug 27, 9:14 am, David Fanning <n...@dfanning.com> wrote:
> xiao writes:
> > Btw, how can I set the intervals of the contour ?

>
> http://www.dfanning.com/tips/nlevels.html
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")


Thank you ,David
Reply With Quote
  #8  
Old 08-27-2008, 10:41 AM
xiao
Guest
 
Default Re: CONTOUR problem

On Aug 27, 9:16 am, xiao <littledd...@gmail.com> wrote:
> On Aug 27, 9:14 am, David Fanning <n...@dfanning.com> wrote:
>
> > xiao writes:
> > > Btw, how can I set the intervals of the contour ?

>
> > http://www.dfanning.com/tips/nlevels.html

>
> > Cheers,

>
> > David
> > --
> > David Fanning, Ph.D.
> > Fanning Software Consulting, Inc.
> > Coyote's Guide to IDL Programming:http://www.dfanning.com/
> > Sepore ma de ni thui. ("Perhaps thou speakest truth.")

>
> Thank you ,David

Sorry, another question....why i always get red as the back ground
color when i use this statement?

!P.background=255 i thought it should be white....
Reply With Quote
  #9  
Old 08-27-2008, 10:51 AM
David Fanning
Guest
 
Default Re: CONTOUR problem

xiao writes:

> Sorry, another question....why i always get red as the back ground
> color when i use this statement?
>
> !P.background=255 i thought it should be white....


http://www.dfanning.com/color_tips/colorchp3.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Reply With Quote
  #10  
Old 08-27-2008, 11:00 AM
Wox
Guest
 
Default Re: CONTOUR problem

On Wed, 27 Aug 2008 07:41:23 -0700 (PDT), xiao <littledddna@gmail.com>
wrote:

>Sorry, another question....why i always get red as the back ground
>color when i use this statement?
>
> !P.background=255 i thought it should be white....


The quick answer would be:

device,decomposed=0
!P.background=255
CONTOUR,s11,rangle,vangle,xrange=[0,180],yrange=[0,90],color=0,xstyle=1,ystyle=1,ytitle='Viewing
zenith angle',xtitle='Relative azimuth angle',C_LABELS=replicate(1,10)

=> note the xstyle,ystyle and color keywords
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 11:32 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.