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

Home » Public Forums » archive » Clipping shade_surf
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
Clipping shade_surf [message #87002] Thu, 19 December 2013 07:49 Go to next message
e.grono is currently offline  e.grono
Messages: 3
Registered: December 2013
Junior Member
I'm running IDL 8.2.0 and have been finding it impossible to successfully use the clip keyword with shade_surf despite the fact the IDL documentation says it should work. No error messages are displayed, the plot just appears without any clipping done. Surface can be clipped successfully so it shouldn't be my use of the keyword causing trouble. Anyone have any experience with this issue?
Re: Clipping shade_surf [message #87003 is a reply to message #87002] Thu, 19 December 2013 08:14 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
e.grono@live.ca writes:

> I'm running IDL 8.2.0 and have been finding it impossible to successfully use the clip keyword with shade_surf despite the fact the IDL documentation says it should work. No error messages are displayed, the plot just appears without any clipping done. Surface can be clipped successfully so it shouldn't be my use of the keyword causing trouble. Anyone have any experience with this issue?

Yes. I wouldn't put too much faith in the documentation. :-)

Can you show us the code you are trying to use and give us some quick
explanation of what you are trying to do with it?

The problem, probably, is that shaded surfaces are returned as images
(although it is hard to realize this). But, I never admit defeat until
I've chewed on it for a day or two. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: Clipping shade_surf [message #87005 is a reply to message #87002] Thu, 19 December 2013 08:28 Go to previous messageGo to next message
e.grono is currently offline  e.grono
Messages: 3
Registered: December 2013
Junior Member
It doesn't take anything too complicated to demonstrate.
z=dist(100)
shade_surf,z,ax=90,az=0,xrange=[40,60],xstyle=1,clip=[40,0,6 0,100],noclip=0
I just want to crop out what goes outside the axes.

How it works with surface:
surface,z,ax=90,az=0,xrange=[40,60],xstyle=1
surface,z,ax=90,az=0,xrange=[40,60],xstyle=1,clip=[40,0,60,1 00],noclip=0

I could just chop out the data I don't want from the array I'm plotting but the resolution of my data set is low enough that when I force the x and y ranges I want I end up with little bars of empty space where there is no data.
Re: Clipping shade_surf [message #87006 is a reply to message #87005] Thu, 19 December 2013 08:51 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
e.grono@live.ca writes:

> It doesn't take anything too complicated to demonstrate.
> z=dist(100)
> shade_surf,z,ax=90,az=0,xrange=[40,60],xstyle=1,clip=[40,0,6 0,100],noclip=0
> I just want to crop out what goes outside the axes.
>
> How it works with surface:
> surface,z,ax=90,az=0,xrange=[40,60],xstyle=1
> surface,z,ax=90,az=0,xrange=[40,60],xstyle=1,clip=[40,0,60,1 00],noclip=0
>
> I could just chop out the data I don't want from the array I'm plotting but the resolution of my data set is low enough that when I force the x and y ranges I want I end up with little bars of empty space where there is no data.

Yes. I doubt you are going to be able to do this.

I think you might be better off to do something like this:

cgplot, [1], xrange=[40,60], yrange=[0,100], /nodata
cgimage, z, xrange=[40,60], yrange=[0,100], /overplot, /scale

That seems to give you the same thing, but you don't have to worry about
clipping the surface. If you wanted the shading to be Gouroud shading,
you could recover the image from Shade_Surf (I would use cgSurf), and
use that with cgImage, I suppose. The point is, cgImage will clip the 2D
array for you, given the current range of the axes.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: Clipping shade_surf [message #87048 is a reply to message #87006] Mon, 30 December 2013 16:04 Go to previous message
e.grono is currently offline  e.grono
Messages: 3
Registered: December 2013
Junior Member
Alright, thanks for your help.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: question about variable intersection
Next Topic: Label orientation

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

Current Time: Wed Oct 08 13:55:52 PDT 2025

Total time taken to generate the page: 0.00602 seconds