Skip to content

Commit 91a1dcf

Browse files
authored
Linejoin settings for geom_step() (#5706)
* add linejoin params to `geom_step()` * add news bullet * tame long line
1 parent dfec855 commit 91a1dcf

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
# ggplot2 (development version)
33

4+
* `geom_step()` now supports `lineend`, `linejoin` and `linemitre` parameters
5+
(@teunbrand, #5705).
46
* Fixed performance loss when the `.data` pronoun is used in `aes()` (#5730).
57
* Fixed bug where discrete scales could not map aesthetics only consisting of
68
`NA`s (#5623)

R/geom-path.R

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,14 @@ geom_step <- function(mapping = NULL, data = NULL, stat = "identity",
322322
#' @export
323323
#' @include geom-path.R
324324
GeomStep <- ggproto("GeomStep", GeomPath,
325-
draw_panel = function(data, panel_params, coord, direction = "hv") {
325+
draw_panel = function(data, panel_params, coord,
326+
lineend = "butt", linejoin = "round", linemitre = 10,
327+
direction = "hv") {
326328
data <- dapply(data, "group", stairstep, direction = direction)
327-
GeomPath$draw_panel(data, panel_params, coord)
329+
GeomPath$draw_panel(
330+
data, panel_params, coord,
331+
lineend = lineend, linejoin = linejoin, linemitre = linemitre
332+
)
328333
}
329334
)
330335

0 commit comments

Comments
 (0)