compose_legend | R Documentation |
compose_legend
recognizes color tables and characters among arguments and passes them to suitable functions for plotting on margins outside of panel area.
compose_legend(...)
... |
If first argument is a list, then either If first argument is
|
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)'
NULL
Nikita Platonov platonov@sevin.ru
legend_colorbar
legend_mtext
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() }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.