Based on hrbrthemes
' theme_ipsum
and customized for lares
usage.
With this team you can custom the colour and fill palettes, global colour parameters,
major and minor grids, legend, font and font size.
theme_lares(
font = Sys.getenv("LARES_FONT"),
size = 12,
main_colour = "darkorange3",
hard_colour = "black",
soft_colour = "grey30",
plot_colour = "transparent",
panel_colour = "transparent",
background = "transparent",
no_facets = FALSE,
legend = NULL,
grid = TRUE,
axis = TRUE,
clean = FALSE,
mg = 9,
pal = 0,
palette = NULL,
which = "fct"
)
Character and numeric. Base font family and base size for texts.
Arial Narrow
is set by default when the library is loaded; you may change it
with Sys.getenv("LARES_FONT" = "X")
or by using this parameter manually.
Character. Main colours for your theme.
Character. Main colour for your background. Overwrites
plot_colour
and panel_colour
.
Boolean. Suppress facet labels?
Character. Legend position: "top"
, "right"
,
"bottom"
, or "left"
You can also set to FALSE
or
"none"
to suppress legend.
Character or Boolean. Use TRUE/FALSE
or a combination of
X
, x
, Y
, y
to enable/disable minor and major grids.
Character or Boolean. Use TRUE/FALSE
, x
or Y
to enable X and/or Y axis lines.
Boolean. Suppress grids and axis? Overwrites both parameters.
Numeric. External margins reference.
Integer. 1
for fill and colour palette,
2
for only colour palette, 3
for only fill palette, 4
for
personal labels-colour palette. 0
for nothing.
Character vector. Pass a vector with HEX colour codes to use a custom palette. If you pass a named vector, the name values will be used as fill and the values will be used as colour.
Character. When pal = 3
, select which colours should be
added with the custom colours palette: fill, colour, text (fct) - first letters.
Themed ggplot2 object
First and foremost, Arial Narrow is generally installed by default or readily available on any modern system, so it's "free"-ish; plus, it is a condensed font with solid default kerning pairs and geometric numbers.
Other Visualization:
distr()
,
freqs_df()
,
freqs_list()
,
freqs_plot()
,
freqs()
,
gg_bars()
,
noPlot()
,
plot_chord()
,
plot_survey()
,
plot_timeline()
,
tree_var()
# NOT RUN {
data(dft)
library(ggplot2)
p <- ggplot(dft, aes(x = Pclass, y = sum(Fare), fill = Pclass)) +
geom_col()
p + theme_lares()
p + theme_lares(pal = 1)
p + theme_lares(background = "#999999", mg = 25)
p + theme_lares(legend = "top", grid = "Yy")
p + theme_lares(clean = TRUE)
# }
Run the code above in your browser using DataLab