Skip to content
Prev 374747 / 398513 Next

[FORGED] Re: drc, ggplot2, and gridExtra

Hi

You need to be careful - you are grid.echo()ing (and then 
grid.grab()ing) on full-size pages and then redrawing in half-height 
pages, which is why you lose the x-axis labels in the result from 
grid.arrange().

This gives a better result (grid.echo() directly in the half-height 
viewports) ...

## grid.newpage()
pushViewport(viewport(y=.5, height=.5, just="bottom"))
grid.echo(function() plot(x, y), newpage=FALSE)
upViewport()
pushViewport(viewport(y=0, height=.5, just="bottom"))
grid.echo(function() plot(a, b), newpage=FALSE)
upViewport()

I have been looking for an example that would demonstrate what an 
echoGrob() function would be for and I think your grid.arrange() example 
might be what I need - thanks for posting this!

Paul
On 19/05/18 04:56, Eivind K. Dovik wrote: