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

Home » Public Forums » archive » cgImage trim
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
cgImage trim [message #92287] Wed, 11 November 2015 00:10 Go to next message
amin farhang is currently offline  amin farhang
Messages: 39
Registered: November 2010
Member
Dear all,

I have an image in a specific range like bellow:

cgDisplay, 500, 500
cgplot,dist(200),xrange=[-300,300],yrange=[-300,300],/nodata
cgImage, cgDemoData(5), CTIndex=33,AlphaFGPos=[0.128, 0.126, 0.925,0.9],Transparent=20

How could i only display the region between xrange=[-100,100] and yrange=[-100,100]? i.e. the axis range show above ranges and image automatically zoom in that region?


Best regards,
Re: cgImage trim [message #92289 is a reply to message #92287] Wed, 11 November 2015 05:43 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Amin Farhang writes:

>
> Dear all,
>
> I have an image in a specific range like bellow:
>
> cgDisplay, 500, 500
> cgplot,dist(200),xrange=[-300,300],yrange=[-300,300],/nodata
> cgImage, cgDemoData(5), CTIndex=33,AlphaFGPos=[0.128, 0.126, 0.925,0.9],Transparent=20
>
> How could i only display the region between xrange=[-100,100] and yrange=[-100,100]? i.e. the axis range show above ranges and image automatically zoom in that region?

You determine which image indices correspond to those axis values and
subset your image appropriately. I like to use Value_Locate, usually in
conjunction with cgScaleVector, to determine the image indices
associated with particular values.

http://www.idlcoyote.com/code_tips/valuelocate.html

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: cgImage trim [message #92294 is a reply to message #92289] Thu, 12 November 2015 10:00 Go to previous message
amin farhang is currently offline  amin farhang
Messages: 39
Registered: November 2010
Member
Thanks David, its work fine
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Backlogged question: Drawing vector fields with same scaling in New Graphics
Next Topic: contour palette

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

Current Time: Wed Oct 08 09:09:14 PDT 2025

Total time taken to generate the page: 0.00494 seconds