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 
Return to the default flat view Create a new topic Submit Reply
Re: Clipping shade_surf [message #87006 is a reply to message #87005] Thu, 19 December 2013 08:51 Go to previous messageGo to previous 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.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: question about variable intersection
Next Topic: Label orientation

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

Current Time: Wed Oct 08 19:32:23 PDT 2025

Total time taken to generate the page: 0.00472 seconds