Learn R Programming

stevethemes (version 0.1.0)

adj_font_size: Miscellaneous functions for fine-tuning ggplot2 plots

Description

These are assorted functions that will fine-tune various things in a ggplot2 plot.

Usage

adj_font_size(x, ...)

Value

adj_font_size() takes a plot made in ggplot2 and changes the font size by some number requested by the user. It returns a plot with bigger or smaller fonts, per the user's request.

Arguments

x

a numeric vector that will adjust the size of all fonts on the plot. Can take decimals and negative numbers.

...

optional, called for side effects

Author

Steven V. Miller

Details

adj_font_size() is a simple wrapper for some basic ggplot2 code that will allow you to adjust the font size on the plot by some number.

Right now, adj_font_size() assumes you are using theme_steve() because the font sizes initialized in the function are defaults from the theme.

Examples

Run this code

library(ggplot2)

example_plot(type = "scatter") + adj_font_size(-2)

example_plot(type = "scatter") + adj_font_size(2)

Run the code above in your browser using DataLab