comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: rescaling an image

Re: rescaling an image
type: item
description: 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.…
creator: marc
date: 1993-08-06T08:07:00-00:00

Re: rescaling an image
type: item
description: 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.
creator: kevin
date: 1993-08-06T20:01:01-00:00