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

Home » Public Forums » archive » Re: How do I plot two images with !P.Multi, while keep the aspect ration reflecting the image size
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: How do I plot two images with !P.Multi, while keep the aspect ration reflecting the image size [message #72259 is a reply to message #72182] Thu, 19 August 2010 09:33 Go to previous message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
Hi all,

I took a stab at doing this in IDL 8.0 with the new graphics:

READ_JPEG, FILEPATH('elev_t.jpg', SUBDIR=['examples','data']), data

x1 = 100 & w = 108
y1 = 100 & h = 128

width = 0.4
pos1 = [0.1, 0.1, 0.1 + width, 0.8]
aspect = float(w)/h
pos2 = pos1
pos2[0] = 0.6
pos2[2] = pos[0] + width*aspect

im1 = IMAGE(data, AXIS_STYLE=1, POSITION=pos1)
im2 = IMAGE(data, /CURRENT, POSITION=pos2, $
XRANGE=[x1,x1+w], YRANGE=[y1,y1+h])


; Add a fancy box and lines showing the "subset" area
rect = POLYGON([x1,x1+w,x1+w,x1],[y1,y1,y1+h,y1+h], /DATA, $
COLOR='red', FILL_BACKGROUND=0, TARGET=im1)
pt1 = im1.ConvertCoord(x1+w,y1+h, /DATA, /TO_NORMAL)
pt2 = im2.ConvertCoord(x1,y1+h, /DATA, /TO_NORMAL)
p = POLYLINE([pt1[0],pt2[0]],[pt1[1],pt2[1]], COLOR='red')
pt1 = im1.ConvertCoord(x1+w,y1, /DATA, /TO_NORMAL)
pt2 = im2.ConvertCoord(x1,y1, /DATA, /TO_NORMAL)
p = POLYLINE([pt1[0],pt2[0]],[pt1[1],pt2[1]], COLOR='red')

; Save the entire window to a PDF file
im1.Save, 'output.pdf'

Sorry it's a bit long. I got all fancy with the boxes and lines. But
it looks nice.

-Chris
ITTVIS
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: IDL syntax highlighting in other documents
Next Topic: Re: IDL syntax highlighting in other documents

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

Current Time: Fri Oct 10 11:14:08 PDT 2025

Total time taken to generate the page: 1.11886 seconds