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

Home » Public Forums » archive » Re: overlying an image and a contour plot
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: overlying an image and a contour plot [message #17849] Mon, 15 November 1999 00:00 Go to previous message
Med Bennett is currently offline  Med Bennett
Messages: 109
Registered: April 1997
Senior Member
A key issue that took me a while to figure out is that the pixels of an
image represent a finite area, unlike grid coordinates. Thus if you
have a grid representing 5000 by 5000 units with a grid spacing of 50
units, your contouring grid will have to be of size 101 by 101. if your
image file also is 101 by 101, the image pixels have to extend *outside*
the axis coordinates by .5 pixels on all sides. I call this a node
centered image. A cell centered image would be only 100 by 100 pixels,
the image occupies the exact coordinate axis ranges, and the first pixel
center is at x[0]+25., y[0]+25. Some extra calculations for the use of
the position keyword are required in the former case. I do the contour
plot first with /nodata to get the exact axis position values, do the
calcs, output the image, and the contour again over the image with the
real data. Easier in postscript be cause it scales the pixels for you -
on screen you have to resize the image appropriately also.

tebbens@my-deja.com wrote:

> We are trying to overlay an image and a contour
> plot, but can't get a perfect match in position
> and size.
>
> On the contour plot, the x axis is 652 values and
> the y axis is 5048 values. We want to fit the
> image exactly into the contour plot.
>
> The following commands are used:
>
> position=[.6,.05,r,.95]
> tv, image, .6, .05, $
> xsize=position(2)-position(0), $
> ysize=position(3)-position(1), /normal
> xvalue = 652.
> yvalue = 5048.
>
> ; r should be the length of the x-axis in the
> ; normal coordinate system (x and y window
> ; size=1)
> r= 10./7.*(.9 * xvalue/yvalue) + .6
>
> contour, xstyle=1, ystyle=1, /iso, $
> position=[.6,.05,r,.95], /noerase
>
> The image and contour overlay, but the x-axis of
> the image is too long to fit the contour plot.
> When the command tvimage is used instead of tv,
> the images are the same size, but are offset in
> both x and y direction by a few pixels.
>
> We think the problem is with the r value, but
> we don't know why the simple commands above
> don't work.
>
> Any suggestions to get these to overlay?
>
> Thanks in advance.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
[Message index]
 
Read Message
Read Message
Previous Topic: Callable IDL and Borland CBuilder 3
Next Topic: Clearing WIDGET_TEXT fields with LOOP

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

Current Time: Sat Oct 11 04:06:48 PDT 2025

Total time taken to generate the page: 1.99797 seconds