[R] setting 'layout' locally within functions

Simon Goodman s.j.goodman at leeds.ac.uk
Wed Jun 22 16:58:19 CEST 2011


Using layout I've created a function that makes a 2 panel plot - comprising a
main plot, and a sub-panel with custom legend.

I would now like to use layout to create multiple panels with plots created
by my function, however the values for layout set in the function act
globally, stopping me from setting this up how I want.

So if I say:

layout(matrix(1:2, 1,2))
my.plot(data)

I end up with a single plot according the layout format specified by the
function, rather than a plot generated by the function in the left hand
panel of the matrix that should be specified by the first layout command.

Is there a way to use layout in a subsetable, hierarchical way?

Thanks, Simon

--
View this message in context: http://r.789695.n4.nabble.com/setting-layout-locally-within-functions-tp3617257p3617257.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list