compose_legend {ursa} | R Documentation |
Plot colorbars or marginal texts.
Description
compose_legend
recognizes color tables and characters among arguments and passes them to suitable functions for plotting on margins outside of panel area.
Usage
compose_legend(...)
Arguments
... |
If first argument is a list, then either If first argument is
|
Details
Named list in the first argument is allowed or named vectors are allowed if first argument is not a list. For legend_colorbar
name of object can be used as an argument units
.
This function is designed to make plot on moderate level of usage with the followed construction:
compose_open(...) compose_panel(...) compose_legend(...) compose_close(...)
Function compose_panel
returns list of color tables of plotted rasters, and followed sequence is available:
ct <- compose_panel(a) compose_legend(ct) # or, if 'a' has color tables, then 'compose_legend(a)'
Value
NULL
Author(s)
Nikita Platonov platonov@sevin.ru
See Also
Examples
session_grid(NULL)
b <- lapply(as.list(ursa_dummy(2)),colorize)
cd <- compose_design(layout=c(1,2),legend=list(list(1,"left"),list(1,"right")
,list("top","full"),list("bottom",1)))
for (i in 1:4) {
compose_open(cd,dev=i==1)
ct <- compose_panel(b,decor=FALSE)
if (i==2)
compose_legend(ct)
else if (i==3)
compose_legend(ct[[1]],'Tomorrow'=b[[2]]
,top="This is example of legend composition"
,format(Sys.Date(),"(c) %Y"))
else if (i==4)
compose_legend(c(ct,"top","bottom"),units=c("left","right"))
compose_close()
}