Description Usage Arguments Format Value Author(s) Examples
Change any of the text parameters such as
which |
which element to change (see |
what |
what attribute of the element to change (see |
to |
value to which the attribute should be set |
teach |
print longer equivalent |
size |
size to set attributes to |
color |
colo(u)r to set attributes to |
colour |
colo(u)r to set attributes to |
An object of class character
of length 15.
a theme
object which can be used in
ggplot2
calls
Jonathan Carroll
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | library(ggplot2)
# make all text larger
ggplot(mtcars, aes(mpg, hp)) +
geom_point() +
easy_all_text_size(22)
# also works if accidentally using easy_text_size(n)
# make the x and y axis text larger
ggplot(mtcars, aes(mpg, hp)) +
geom_point() +
easy_text_size(c("axis.text.x", "axis.text.y"), 22)
# make the x axis labels larger
ggplot(mtcars, aes(mpg, hp)) +
geom_point() +
easy_x_axis_labels_size(22)
# make the plot title larger
ggplot(mtcars, aes(mpg, hp)) +
geom_point() +
labs(title = "My Plot") +
easy_plot_title_size(22)
# make the legend title larger
ggplot(mtcars, aes(mpg, hp)) +
geom_point(aes(fill = gear)) +
easy_plot_legend_title_size(22)
# make all the text red
ggplot(mtcars, aes(mpg, hp)) +
geom_point(aes(fill = gear)) +
easy_all_text_color("red")
# make all the text 45 degrees, right-justified
ggplot(mtcars, aes(mpg, hp)) +
geom_point(aes(fill = gear)) +
easy_change_text(what = "angle", to = 45) +
easy_change_text(what = "hjust", to = 1)
# make just x-axis text 45 degrees, right-justified
ggplot(mtcars, aes(mpg, hp)) +
geom_point(aes(fill = gear)) +
easy_change_text(which = "axis.text.x", what = "angle", to = 45) +
easy_change_text(which = "axis.text.x", what = "hjust", to = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.