paul murrell pmurrellaucklandacnz hi peter cowan wrote hello im trying write function produces main plotting region several square plots along right side ideally size right side plots scale height entire plot yet never overlap another secondary plot following two snippets get close however resize plot horizontally right side plots green squares get smaller whereas id like remain size seems answer lies setting layout width side plot column clever way havent able discover suggestions achieve effect improvements code welcome hopefully explanation makes goal clear also note real application function arbitrary numbers side plots sorry im completely sure want end either following come close side plots square attached tall plot get gaps top bottom wide plot get gap right lay1 gridlayout1 2 widthsc10 1 lay2 gridlayout10 1 respecttrue justleft gridnewpage pushviewportviewportwidth8 height8 layoutlay1 gridrectgpgparcolgrey pushviewportviewportlayoutposcol1 gridrectgpgparfillgrey popviewport pushviewportviewportlayoutposcol2 layoutlay2 110 pushviewportviewportlayoutposrowi gridrectgpgparfilllight grey popviewport popviewport side plots square separate tall plot get gaps vertically wide plot get gap right lay1 gridlayout10 2 widthsc10 1 gridnewpage pushviewportviewportwidth8 height8 layoutlay1 gridrectgpgparcolgrey pushviewportviewportlayoutposcol1 gridrectgpgparfillgrey popviewport 110 pushviewportviewportlayoutposcol2 layoutposrowi pushviewportviewportx0 widthunit1 snpc heightunit1 snpc justleft gridrectgpgparfilllight grey popviewport2 paul thanks peter requiregrid gridnewpage lout1 gridlayoutnrow 1 ncol 2 widths unitc1 110 cnull snpc pushviewportviewportlayout lout1 w 08 h 08 pushviewportviewportlayoutposcol 1 gridrect popviewport pushviewportviewportlayoutposcol 2 lout2 gridlayoutnrow 10 ncol 1 heights unit1 snpc pushviewportviewportlayout lout2 fori seq0 1 lengthout 10 pushviewportviewporty width unit1 snpc height unit1 snpc gridrectgp gparcol 3 popviewport popviewport popviewport popviewport gridnewpage lout3 gridlayoutnrow 10 ncol 11 respect matrixcrep0 10 10 rep0 10 1 1 nrow 10 pushviewportviewportlayout lout3 w 08 h 08 pushviewportviewportlayoutposcol 110 gridrect popviewport pushviewportviewportlayoutposcol 11 fori seq0 1 lengthout 10 pushviewportviewporty width unit1 snpc height unit1 snpc gridrectgp gparcol 3 popviewport popviewport popviewport ______________________________________________ rhelprprojectorg mailing list httpsstatethzchmailmanlistinforhelp please read posting guide httpwwwrprojectorgpostingguidehtml provide commented minimal selfcontained reproducible code dr paul murrell department statistics university auckland private bag 92019 auckland new zealand 64 9 3737599 x85392 paulstataucklandacnz httpwwwstataucklandacnzpaul ______________________________________________ rhelprprojectorg mailing list httpsstatethzchmailmanlistinforhelp please read posting guide httpwwwrprojectorgpostingguidehtml provide commented minimal selfcontained reproducible code thu 07 aug 2008 084034 1200 r grid layout scaling viewport width based solely height