theme_cr | R Documentation |
The default customized theme for figure creation. This is also used as the base theme for additional modifications, such as for bar graphs and heat maps.
theme_cr(
plot_scale = 1,
font_scale = 1,
font = "Roboto Regular",
symbol = TRUE,
cairo = FALSE
)
plot_scale |
Scaling factor for the plot components as a whole. A value of 1 corresponds to a font size of 12 pt and a figure size of 6" by 4" |
font_scale |
Scaling factor for the font as compared to the plot. A value of 1 will scale the font to the plot size. Larger numbers make the font large compared to the plot size; smaller numbers make the font small compared to the plot size. |
font |
Font family to be used in the theme, given as a character vector.
The font must be included in the theme fonts; use
|
symbol |
Should the theme overwrite the system default Symbol font with
the theme default font? If |
cairo |
Is a cairographics device being used to save the figure? ("pdf"
and "eps" filetypes) Cairo does not use the font registration from the
|
This builds off of the theme_gray
function from the
ggplot2
package. It overrides components of the
theme_gray
function with the function-specified components, resulting
in a completely custom theme. It uses the packaged fonts by default.
A list containing the theme properties.
library(ggplot2)
df <- data.frame(x = 1:5, y = 1:5, z = c("a", "b", "c", "b", "c"))
p <- ggplot(df, aes(x, y, color = z)) + geom_point()
## Not run:
p + theme_cr() # Uses default scaling and font
p + theme_cr(font = "Roboto Medium") # Bolder font
p + theme_cr(plot_scale = 2) # Multiply height and width of the plot by 2
p + theme_cr(font = "Roboto Medium", symbol = FALSE) # Use system Symbol font
p + theme_cr(font = "Avenir", cairo = TRUE) # Use a cairo-safe font
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.