Re: how to draw three-dimension graph using IDL [message #43625] |
Tue, 19 April 2005 23:14 |
Dick Jackson
Messages: 347 Registered: August 1998
|
Senior Member |
|
|
"lixiaoyao" <lixiaoyao5880@yahoo.com> wrote in message
news:1113946934.318245.263170@l41g2000cwc.googlegroups.com.. .
> how to set the contour to a wanted point? for example contour =0.1
Online Help for "ISURFACE procedure" gives this:
Insert a contour onto the surface by clicking the Surface Contour button on
the toolbar, then clicking and dragging on the surface to position the
contour at the desired height.
But I found that I couldn't get any contours with:
iSurface, sin(xx)*sin(yy),xx,yy
... I had to just use:
iSurface, sin(xx)*sin(yy)
I think that if you look in Online Help:Using IDL iTools:Working with
Surfaces (or Contours) you will find more of what you are looking for.
Cheers,
--
-Dick
Dick Jackson / dick@d-jackson.com
D-Jackson Software Consulting / http://www.d-jackson.com
Calgary, Alberta, Canada / +1-403-242-7398 / Fax: 241-7392
|
|
|
|
Re: how to draw three-dimension graph using IDL [message #43652 is a reply to message #43641] |
Tue, 19 April 2005 12:23  |
Dick Jackson
Messages: 347 Registered: August 1998
|
Senior Member |
|
|
... or for even more fun, as your last command, use this:
iSurface, sin(xx)*sin(yy),xx,yy
or
iSurface, sin(xx)*sin(yy),xx,yy, /Isotropic
(for isotropic or equally-scaled X, Y and Z axes)
Cheers,
--
-Dick
Dick Jackson / dick@d-jackson.com
D-Jackson Software Consulting / http://www.d-jackson.com
Calgary, Alberta, Canada / +1-403-242-7398 / Fax: 241-7392
"Paolo Grigis" <pgrigis@astro.phys.ethz.ch> wrote in message
news:42651ae7$1@news1.ethz.ch...
> for a surface, you could try:
>
> x=4*!pi*findgen(101)/100
> y=4*!pi*findgen(101)/100
>
> xx=rebin(x,n_elements(x),n_elements(y))
> yy=rebin(transpose(y),n_elements(x),n_elements(y))
>
> shade_surf,sin(xx)*sin(yy),xx,yy
>
> --Paolo
>
> lixiaoyao wrote:
>> hello all
>> for example,how to draw z=sin(x)*sin(y)
>> also,if you have a three column file,and how draw three dimension
>> graph from the data.
>> Thanks a lot
>>
|
|
|
Re: how to draw three-dimension graph using IDL [message #43661 is a reply to message #43652] |
Tue, 19 April 2005 08:54  |
Paolo Grigis
Messages: 171 Registered: December 2003
|
Senior Member |
|
|
lixiaoyao wrote:
> thank you so much,you are so powerful.
> Paolo Grigis wrote:
>
>> for a surface, you could try:
>>
>> x=4*!pi*findgen(101)/100
>> y=4*!pi*findgen(101)/100
>>
>> xx=rebin(x,n_elements(x),n_elements(y))
>> yy=rebin(transpose(y),n_elements(x),n_elements(y))
>
> why does there need to transpose? I am a little bit confuse.
Well, of course you have to try to understand the code
for yourself, the best way to do it is to try out with
a simple example:
x=[1,2,3]
y=[1,2,3]
xx=rebin(x,n_elements(x),n_elements(y))
yy=rebin(transpose(y),n_elements(x),n_elements(y))
IDL> print,xx
1 2 3
1 2 3
1 2 3
IDL> print,yy
1 1 1
2 2 2
3 3 3
(you see why I had to transpose to get yy?)
IDL> z=xx+yy
IDL> print,z
2 3 4
3 4 5
4 5 6
Now z[i,j] is equal to x[i]+y[j], and the "rebin" call
was used to inflate the x and y array in order to avoid
the need of writing two nested for loops over i and j
to fill out the values of z[i,j]=x[i]+y[j].
Paolo
>
>> shade_surf,sin(xx)*sin(yy),xx,yy
|
|
|
Re: how to draw three-dimension graph using IDL [message #43669 is a reply to message #43661] |
Tue, 19 April 2005 08:11  |
lixiaoyao
Messages: 49 Registered: April 2005
|
Member |
|
|
thank you so much,you are so powerful.
Paolo Grigis wrote:
> for a surface, you could try:
>
> x=4*!pi*findgen(101)/100
> y=4*!pi*findgen(101)/100
>
> xx=rebin(x,n_elements(x),n_elements(y))
> yy=rebin(transpose(y),n_elements(x),n_elements(y))
why does there need to transpose? I am a little bit confuse.
>
> shade_surf,sin(xx)*sin(yy),xx,yy
also,how to draw thw contour and how to change the view angel?
Thanks a billion!
>
> --Paolo
>
> lixiaoyao wrote:
>> hello all
>> for example,how to draw z=sin(x)*sin(y)
>> also,if you have a three column file,and how draw three dimension
>> graph from the data.
>> Thanks a lot
>>
|
|
|
Re: how to draw three-dimension graph using IDL [message #43672 is a reply to message #43669] |
Tue, 19 April 2005 07:51  |
Paolo Grigis
Messages: 171 Registered: December 2003
|
Senior Member |
|
|
for a surface, you could try:
x=4*!pi*findgen(101)/100
y=4*!pi*findgen(101)/100
xx=rebin(x,n_elements(x),n_elements(y))
yy=rebin(transpose(y),n_elements(x),n_elements(y))
shade_surf,sin(xx)*sin(yy),xx,yy
--Paolo
lixiaoyao wrote:
> hello all
> for example,how to draw z=sin(x)*sin(y)
> also,if you have a three column file,and how draw three dimension
> graph from the data.
> Thanks a lot
>
|
|
|