plotstyle | R Documentation |
Returns a named vector (using entity names) with style codes (e.g. colors) for given entities.
plotstyle(
...,
out = "color",
unknown = NULL,
plot = FALSE,
verbosity = getOption("plotstyle.verbosity"),
regexp = FALSE
)
... |
One or more strings or a vector of strings with names of entities (regions, variable names, etc.). Units in brackets "(US$2005/GJ)" will be ignored. If left empty all available entities will be used |
out |
Switch defining which type of plot style you want to get: Currently you can choose between "color", "legend" and "all" (the latter will return a dataframe with all available plot styles) |
unknown |
Optional data frame defining plot styles for unknown entities. A default color map will be used for unknown entities if nothing is provided here |
plot |
If TRUE plots with all given entities and their colors will be
produced (to produce plots with all available entities leave the |
verbosity |
Set to 1 if you want to know for which unknown entities plotstyle brewed colors |
regexp |
If |
Plot styles for given entities
David Klein, Jan Philipp Dietrich
plotstyle.add
entities <- c("AFR", "AAA", "AFR", "UNKNOWN_ELEMENT2")
plotstyle(entities)
unknown <- data.frame(row.names = c("AAA", "UNKNOWN_ELEMENT2"),
color = c("#123456", "#345678"),
legend = c("l_AAA", "l_UNKNOWN_ELEMENT2"))
plotstyle(entities, unknown = unknown)
plotstyle(entities, out = "legend")
plotstyle(entities, out = "all")
# search for all 'Final Energy Biomass' entities
plotstyle("^Final Energy\\|.*Biomass", regexp = TRUE)
# search for all three-letter entities (a.k.a. regions)
plotstyle("^[A-Z]{3}$", regexp = TRUE, out = "all")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.