Skip to content

Commit f2ad948

Browse files
authored
📝 Mention (fill_)alpha() in theme element docs (#6283)
* mention alpha/fill_alpha in params * sprinkle comments in examples
1 parent a85c6a2 commit f2ad948

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

R/theme-elements.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
#' `margin()`, `margin_part()` and `margin_auto()` are all used to specify the
1515
#' margins of elements.
1616
#'
17-
#' @param fill Fill colour.
17+
#' @param fill Fill colour. `fill_alpha()` can be used to set the transparency
18+
#' of the fill.
1819
#' @param colour,color Line/border colour. Color is an alias for colour.
20+
#' `alpha()` can be used to set the transparency of the colour.
1921
#' @param linewidth,borderwidth Line/border size in mm.
2022
#' @param size,fontsize text size in pts.
2123
#' @param arrow.fill Fill colour for arrows.
@@ -26,17 +28,21 @@
2628
#' calculating final element state.
2729
#' @return An S3 object of class `element`, `rel`, or `margin`.
2830
#' @examples
31+
#' # A standard plot
2932
#' plot <- ggplot(mpg, aes(displ, hwy)) + geom_point()
3033
#'
34+
#' # Turning off theme elements by setting them to blank
3135
#' plot + theme(
3236
#' panel.background = element_blank(),
3337
#' axis.text = element_blank()
3438
#' )
3539
#'
40+
#' # Text adjustments
3641
#' plot + theme(
3742
#' axis.text = element_text(colour = "red", size = rel(1.5))
3843
#' )
3944
#'
45+
#' # Turning on the axis line with an arrow
4046
#' plot + theme(
4147
#' axis.line = element_line(arrow = arrow())
4248
#' )

man/element.Rd

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)