Title: | A ggplot2 Theme using the Fira Sans Font |
---|---|
Description: | Make your graphs pretty with the Fira font, colours and prettified axes and labels. |
Authors: | Erik-Jan van Kesteren |
Maintainer: | Erik-Jan van Kesteren <[email protected]> |
License: | MIT + file LICENCE |
Version: | 0.2.4 |
Built: | 2024-11-21 03:04:01 UTC |
Source: | https://github.com/vankesteren/firatheme |
This is a vector with 5 colours to be used in palettes and other visual elements.
firaCols
firaCols
An object of class character
of length 5.
This function outputs n colours from the fira ggplot2 theme palette
firaPalette(n = 5)
firaPalette(n = 5)
n |
the number of colours to output |
This function behaves like ggsave
but automatically embeds the fira
font if the output format requires it. Install 64-bit GhostScript for this
functionality. Currently only works automatically on Windows. For other
platforms, run the following with the _correct_ location to the installed
GhostScript Binary: Sys.setenv(R_GSCMD = "bin/gs/gs9.23/binaryname")
firaSave(filename = "plot.pdf", device = "pdf", ...)
firaSave(filename = "plot.pdf", device = "pdf", ...)
filename |
path to a file |
device |
which type of output device to use |
... |
other arguments passed to ggsave |
Colour scales belonging to the fira theme
scale_fill_fira(..., continuous = FALSE) scale_colour_fira(..., continuous = FALSE) scale_color_fira(..., continuous = FALSE)
scale_fill_fira(..., continuous = FALSE) scale_colour_fira(..., continuous = FALSE) scale_color_fira(..., continuous = FALSE)
... |
Arguments passed on to
|
continuous |
whether the associated variable should be considered continuous. Typically used after "Error: Continuous value supplied to discrete scale" |
This theme uses Mozilla's Fira Sans as its font.
Save to pdf using firaSave()
.
theme_fira(family = "Fira Sans")
theme_fira(family = "Fira Sans")
family |
Change the font family. Defaults to Fira Sans |
ggplot theme
library(ggplot2) ggplot(mtcars, aes(x = mpg*0.43, y = wt*0.4535924, colour = factor(cyl))) + geom_point(size = 2) + labs(title = "Car weight vs efficiency", subtitle = "Using sensible metrics", x = "Efficiency (km/l)", y = "Weight (1000 kg)", colour = "Cylinders") + theme_fira() + scale_colour_fira()
library(ggplot2) ggplot(mtcars, aes(x = mpg*0.43, y = wt*0.4535924, colour = factor(cyl))) + geom_point(size = 2) + labs(title = "Car weight vs efficiency", subtitle = "Using sensible metrics", x = "Efficiency (km/l)", y = "Weight (1000 kg)", colour = "Cylinders") + theme_fira() + scale_colour_fira()