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 #83287 is a reply to message #83286] Tue, 12 February 2013 06:20 Go to previous messageGo to previous message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
Hi David,

Thanks, I adapted your idea in my code and after a few dozens of tries I
am satisfied with the output ;-) I won't change anything at the code
anymore though!

Cheers,

Fabien

On 02/12/2013 02:54 PM, David Fanning wrote:
> 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
>
[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: Sat Oct 11 09:51:41 PDT 2025

Total time taken to generate the page: 0.96004 seconds