Title: | Templates for Me |
---|---|
Description: | Provides opinionated ggplot2 themes and other templates for my own use. |
Authors: | Michael Schramm [aut, cre] |
Maintainer: | Michael Schramm <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.2.0 |
Built: | 2024-11-04 05:04:28 UTC |
Source: | https://github.com/mps9506/mpsTemplates |
The mpsTemplates package provides opinionated ggplot themes
Maintainer: Michael Schramm [email protected]
Useful links:
Change geom defaults from black to custom lights
noto_dark_geom_defaults()
noto_dark_geom_defaults()
Provides a ggplot2 theme.
theme_mps_noto( base_size = 11, base_family = "NotoSansDisplay_Condensed", base_line_size = 0.5, base_rect_size = 0.5 )
theme_mps_noto( base_size = 11, base_family = "NotoSansDisplay_Condensed", base_line_size = 0.5, base_rect_size = 0.5 )
base_size |
default text size in px |
base_family |
defaults to |
base_line_size |
default line size |
base_rect_size |
default rect size |
Uses Google's Noto Sans Display font by default. Using the
ragg::agg_png()
or related graphics device should ensure the font is
properly detected and used.
library(ggplot2) library(ragg) file <- tempfile(fileext = '.png') agg_png(file) ggplot(cars) + geom_point(aes(speed, dist)) + theme_mps_noto() + labs(title = "Cars", subtitle = "Speed and stopping distance", caption = "Ezekiel, M (1930) Methods of Correlation Analysis", x = "Speed [mph]", y = "Stopping Distance [ft]") dev.off()
library(ggplot2) library(ragg) file <- tempfile(fileext = '.png') agg_png(file) ggplot(cars) + geom_point(aes(speed, dist)) + theme_mps_noto() + labs(title = "Cars", subtitle = "Speed and stopping distance", caption = "Ezekiel, M (1930) Methods of Correlation Analysis", x = "Speed [mph]", y = "Stopping Distance [ft]") dev.off()
Provides a ggplot2 theme.
theme_mps_noto_dark( base_size = 11, base_family = "NotoSansDisplay_SC", base_line_size = 0.5, base_rect_size = 0.5 )
theme_mps_noto_dark( base_size = 11, base_family = "NotoSansDisplay_SC", base_line_size = 0.5, base_rect_size = 0.5 )
base_size |
default text size in px |
base_family |
defaults to |
base_line_size |
default line size |
base_rect_size |
default rect size |
Uses Google's Noto Sans Display font by default. Using the
ragg::agg_png()
or related graphics device should ensure the font is
properly detected and used.
library(ggplot2) library(ragg) file <- tempfile(fileext = '.png') agg_png(file) ggplot(cars) + geom_point(aes(speed, dist)) + theme_mps_noto_dark() + labs(title = "Cars", subtitle = "Speed and stopping distance", caption = "Ezekiel, M (1930) Methods of Correlation Analysis", x = "Speed [mph]", y = "Stopping Distance [ft]") dev.off()
library(ggplot2) library(ragg) file <- tempfile(fileext = '.png') agg_png(file) ggplot(cars) + geom_point(aes(speed, dist)) + theme_mps_noto_dark() + labs(title = "Cars", subtitle = "Speed and stopping distance", caption = "Ezekiel, M (1930) Methods of Correlation Analysis", x = "Speed [mph]", y = "Stopping Distance [ft]") dev.off()