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

Home » Public Forums » archive » Re: rescaling an image
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
Re: rescaling an image [message #1105] Fri, 06 August 1993 13:01
kevin is currently offline  kevin
Messages: 17
Registered: August 1992
Junior Member
jabarone@athena.mit.edu (John A Barone) writes:


> Hi,
>
> I'm trying to view a 3-D image in two different windows of two
> different sizes. I would like the image to look aproximately the
> same in both windows. The problem is that the two windows are
> different sizes (specifically 608x486 and 576x792). Obviously when
> I plot the data using SURFACE the results are quite different in each
> window. I've been trying to fool around with the POSITION key word to
> scale the plot so that it looks the same in both windows, but I haven't
> come up with any satisfactory results. Does anyone know of a way to do this?
> Any help would be greatly appreciated.

If you want the images to fill up the entire window, the try using the congrid
function:

new_image=congrid(old_image,!d.x_vsize,!d.y_vsize,/interp)
tvscl,new_image
Thanks in advance.
Re: rescaling an image [message #1110 is a reply to message #1105] Fri, 06 August 1993 01:07 Go to previous message
marc is currently offline  marc
Messages: 6
Registered: February 1992
Junior Member
In article <23p4il$jic@senator-bedfellow.MIT.EDU>, jabarone@athena.mit.edu (John A Barone) writes:
|> Hi,
|>
|> I'm trying to view a 3-D image in two different windows of two
|> different sizes. I would like the image to look aproximately the
|> same in both windows. The problem is that the two windows are
|> different sizes (specifically 608x486 and 576x792). Obviously when
|> I plot the data using SURFACE the results are quite different in each
|> window. I've been trying to fool around with the POSITION key word to
|> scale the plot so that it looks the same in both windows, but I haven't
|> come up with any satisfactory results. Does anyone know of a way to do this?
|> Any help would be greatly appreciated.
|>
|> Thanks in advance.
|>
|>
|> John Barone
|> jabarone@athena.mit.edu
|>
|>

--


You weren't specific enough about how different they looked, and what was
wrong, ie. what you want to fix about them.

If the problem is that one window has height/width ratio = 1.251, while
the other has ratio = .727, I think that !P.REGION is the right variable
to fart with.

Assuming you want the second to be like the first, and that "look
like" really means has same plotsize ratio, do the following:


;Backup previous region setting

tempRegion = !P.Region


; draw the first plot in its window. Then get view sizes

dx1 = !D.X_Vsize
dy1 = !D.Y_Vsize
Ratio1 = float(!D.X_Vsize) / !D.Y_Vsize


; Make new window and get new sizes, dx2, dy2, Ratio2, then

dx2New = dx2
dy2New = float( dx2 ) / ratio1

If dy2New GT dy2 Then Begin
dx2New = dy2 * ratio1
dy2New = dy2
Endif


normSizeX = float( dx2New ) / dx2
normSizeY = float( dy2New ) / dy2

!P.Region = [ 0.5 - normSizeX/2., 0.5 - normSizeY/2., $
0.5 + normSizeX/2., 0.5 + normSizeY/2. ]

; then plot in new window

!P.Region = tempRegion

This should work. You will have then to fart around with charsize, and
ticklen, and all the other junk you put on the plots, because all this
will probablyhave to be scaled to really make the second look like the first.
Hope this helps.


M



------------------------------------------------------------ --------------------

Marc Day, graduate student _/ _/ _/_/_/ _/_/_/_/ _/_/_/
Institute of Plasma Fusion Research _/_/ _ _/ _/ _/ _/ _/ _/ _/
44-139 Engineering IV _/ _/ _/ _/_/_/_/ _/_/_/ _/
University of California _/ _/ _/ _/ _/ _/ _/ _/
Los Angeles, CA 90024-1597 _/ _/ _/ _/ _/ _/ _/_/_/
Internet: day@fusion.ucla.edu
...surf in peace, with your best friends
------------------------------------------------------------ --------------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL Licenses and architectures (was IDL LICENSING MADNESS)
Next Topic: Solution to CURSOR problem

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

Current Time: Wed Oct 08 19:22:02 PDT 2025

Total time taken to generate the page: 0.00510 seconds