lixiaoyao writes:
> Hi all
> This time I have read all the manual for contour,I have a question,my
> code is
> in the following. I will say problem following,please help me.
> ;DEVICE,RETAIN=2
> set_plot,'ps',/copy
> device,filename='isothermal.ps'
> device,/landscape
>
>
> MAX=100
> x=2*findgen(MAX)/MAX+0.1
> y=2*findgen(MAX)/MAX+0.1
> F=exp(y^2/2-alog(y))
> G=(exp(2*alog(x)+1/x))
> R=fltarr(MAX,MAX)
> for i=0,MAX-1 do R(i,*)=F
> for j=0,MAX-1 do R(*,j)/=G
> contour,R,x,y,levels=[0.6,0.7,0.8,0.892521,1.0,1.1,1.2],c_la bels=[1,1,1,1,1,1,1],xtitle='Dimensionless
> Radius',ytitle='Mach number',title='Isothermal case'
>
> until now,it give the correct answer.
>
> MAX=100
> x=2*findgen(MAX)/MAX+0.1
> y=2*findgen(MAX)/MAX+0.1
> F=exp(y^2/2-alog(y))
> G=(exp(2*alog(x)+1/x))
> R=fltarr(MAX,MAX)
> for i=0,MAX-1 do R(i,*)=F
> for j=0,MAX-1 do R(*,j)/=G
> contour,R,x,y,level=[0.892521],path_xy=xy,path_info=info,clo sed=0,/path_double
> for I=0,(N_ELEMENTS(info)-1) DO BEGIN
> S=[INDGEN(info(I).N),0]
> print,xy(*,INFO(I).OFFSET+S)
> ; plots,xy(*,INFO(I).OFFSET+S),/norm
> endfor
> this times contour results do not agree with I got from the above code.
> I have read all the contour help file,I just can not know to solver
> it.IF who knows the question is,please tell me.
I don't know. It works for me. You will need these two
programs from my web page to run the code below:
http://www.dfanning.com/programs/loaddata.pro
http://www.dfanning.com/programs/scale_vector.pro
Cheers,
David
PRO Example
x = findgen(41)
y = findgen(41)
r = loaddata(2)
r = scale_vector(r, 0.4, 1.4)
TVLCT, 0, 255, 0, 1
TVLCT, 255, 255, 0, 2
window, 1
device, decomposed=0
contour,R,x,y,levels=[0.6,0.7,0.8,0.892521,1.0,1.1,1.2],$
c_labels=[1,1,1,1,1,1,1],$
xtitle='Dimensionless Radius',ytitle='Mach number',$
title='Isothermal case', $
c_colors=[255, 255, 255, 2, 255, 255, 255]
contour,R,x,y,level=[0.892521],path_xy=xy,$
path_info=info,closed=0,/path_double
window, 2
contour,R,x,y,levels=[0.6,0.7,0.8,0.892521,1.0,1.1,1.2],$
c_labels=[1,1,1,1,1,1,1],$
xtitle='Dimensionless Radius',ytitle='Mach number',$
title='Isothermal case', /Nodata
for I=0,(N_ELEMENTS(info)-1) DO BEGIN
S=[INDGEN(info(I).N),0]
print,xy(*,INFO(I).OFFSET+S)
plots,xy(*,INFO(I).OFFSET+S),/norm, color=1, linestyle=2
endfor
END
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|