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

Home » Public Forums » archive » Re: cGimage, Multiplot with /KEEP_ASPECT_RATIO
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: cGimage, Multiplot with /KEEP_ASPECT_RATIO [message #83288 is a reply to message #83287] Tue, 12 February 2013 05:54 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Fab writes:

> In the following I am making two plots with cg* routines.
>
> img1 = cgDemoData(7)
> img2 = congrid(img1, 360, 180)
> cgDisplay, 900, 400
> !P.Multi = [0, 2, 1]
> multimargin = [1,1,1,1]
> cgImage, img1, MULTIMARGIN=multimargin, /KEEP_ASPECT_RATIO, /AXES
> cgImage, img2, MULTIMARGIN=multimargin, /KEEP_ASPECT_RATIO, /AXES
> !P.Multi = 0
>
> Nice, but I would like the top limit of the plots being the same
> (meaning translate the second plot upwards a bit). I could'nt find an
> easy solution. There must be one though! Any thoughts?

POSITION keyword. Heterogeneous positioning of plots is not the forte
of !P.MULTI, who is a guy who craves repetition and homogeneity. :-)

And, since you are asking to keep the aspect ratio, you will have to
be prepared to adjust the position of the second image in Y space.
I would probably try something like this.

;--------------------------------------------------
img1 = cgDemoData(7)
img2 = congrid(img1, 360, 180)
cgDisplay, 900, 400
cgImage, img1, /KEEP_ASPECT_RATIO, /AXES, $
POSITION=[0.05, 0.1, 0.475, 0.90], OPOSITION=op

s = Size(img2, /Dimensions)
imgaspect = Float(s[1])/s[0]

xdist = 0.95-0.525
ydist = (xdist * imgaspect) * 2
pos2 = [0.525, op[3]-ydist, 0.95, op[3]]
cgImage, img2, /AXES, POSITION=pos2, /NoErase
;--------------------------------------------------


Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: cGimage, Multiplot with /KEEP_ASPECT_RATIO
Next Topic: Re: XYOUTS in 3D

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

Current Time: Wed Oct 08 18:04:07 PDT 2025

Total time taken to generate the page: 0.00180 seconds