View source: R/design_mytheme.R
design_mytheme | R Documentation |
This function modifies a ggplot2 theme based on user-defined parameters for various plot elements. It allows customization of the theme's appearance, including title size, axis size, legend position, and more.
design_mytheme(
theme = "light",
plot_title_size = 2,
axis_title_size = 2,
axis_text_size = 12,
axis_angle = 60,
hjust = 1,
legend.position = NULL,
legend.direction = NULL,
legend.size = 0.25,
legend.key.height = 0.5,
legend.key.width = 0.5,
legend.size.text = 10,
legend.box = "horizontal"
)
theme |
The desired theme for the plot. Options include "light", "bw", "classic", and "classic2". Default is "light". |
plot_title_size |
The size of the plot title. Default is 2. |
axis_title_size |
The size of the axis titles. Default is 2. |
axis_text_size |
The size of the axis tick mark labels. Default is 12. |
axis_angle |
The angle of rotation for the x-axis tick mark labels. Default is 60. |
hjust |
horizontal justification |
legend.position |
The position of the legend in the plot. Options include "none", "left", "right", "bottom", and "top". Default is NULL. |
legend.direction |
The direction of the legend items. Options include "horizontal" and "vertical". Default is NULL. |
legend.size |
The size of the legend key. Default is 0.25. |
legend.key.height |
The height of the legend key. Default is 0.5. |
legend.key.width |
The width of the legend key. Default is 0.5. |
legend.size.text |
The size of the legend text labels. Default is 10. |
legend.box |
The orientation of the legend box. Options include "horizontal" and "vertical". Default is "horizontal". |
mytheme
Dongqiang Zeng
mytheme <- design_mytheme()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.