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

Home » Public Forums » archive » Re: IDLgrImage image plot problem
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: IDLgrImage image plot problem [message #50297] Tue, 26 September 2006 14:11 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
yy writes:

> I want to plot a 2D data set by using object graphics.
> And I want it to be colored. If I use direct graphics plot,
> it can be done as the following:
> WINDOW, 0, XSIZE=300, YSIZE=300
> LOADCT,13
> IMAGE_AX, 2ddata
>
> However, when I try to use IDLgrImage, nothing appears
> on screen. I don't know if it's because I didn't position the
> image correctly. But if it is, I still don't know how to find the
> image. Below is what I did:
> oWindow = OBJ_NEW('IDLgrWindow', DIMENSIONS=[300,300])
> oView = OBJ_NEW('IDLgrView')
> oModel = OBJ_NEW('IDLgrModel')
>
> ; Load color table 13
> oPalette = OBJ_NEW('IDLgrPalette')
> oPalette -> LoadCT, 13
> oImage = OBJ_NEW('IDLgrImage', 2ddata, PALETTE = oPalette)
>
> oModel -> Add, oImage
> oView -> Add, oModel
> oWindow -> Draw, oView

Well, I think what you put in the window is the lower-left
pixel of your image. Don't worry, in my experience about
85% of the people who start using object graphics in IDL
do this. I certainly did. :-)

You are going to have to decide what kind of coordinate
system you are going to use in your view object. It
might make a LOT more sense to use a coordinate system
more in line with your image dimensions that with the
default coordinate system that will show a single pixel.
Check your viewplance rectangle. And you might have a look
at ximage.pro in the Coyote directory for an alternate way
to get to the same place:

http://www.dfanning.com/programs/ximage.pro

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Previous Topic: how to keep an image object in the window?
Next Topic: Re: Dereferencing a large array in a structure

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

Current Time: Wed Oct 08 17:35:44 PDT 2025

Total time taken to generate the page: 0.00383 seconds