Skip to content

Commit

Permalink
New argument stroke added #236
Browse files Browse the repository at this point in the history
  • Loading branch information
kassambara committed May 10, 2020
1 parent 41df11e commit cd9bcd9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

## Minor changes

- New argument `stroke` supported in `ggscatter()` and in `ggline()`. Used only for shapes 21-24 to control the thickness of points border ([@bioguy2018, #258](https://github.com/kassambara/ggpubr/issues/236)).
- the `stat_cor()` function code has been simplified. New arguments `p.accuracy` and `r.accuracy` added; a real value specifying the number of decimal places of precision for the p-value and the correlation coefficient, respectively. Default is NULL. Use (e.g.) 0.01 to show 2 decimal places of precision ([@garthtarr, #186](https://github.com/kassambara/ggpubr/issues/186), [@raedevan6, #114](https://github.com/kassambara/ggpubr/issues/114), [#270](https://github.com/kassambara/ggpubr/issues/270)).


Expand Down
2 changes: 2 additions & 0 deletions R/geom_exec.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ geom_exec <- function (geomfunc = NULL, data = NULL,
"x", "y", "color", "colour", "linetype", "fill", "size", "shape", "width",
"alpha", "na.rm", "lwd", "pch", "cex", "position", "stat", "geom",
"show.legend", "inherit.aes", "fun.args", "fontface",
# point
"stroke",
# boxplot
"outlier.colour", "outlier.shape", "outlier.size",
"outlier.stroke", "notch", "notchwidth", "varwidth",
Expand Down
10 changes: 6 additions & 4 deletions R/ggline.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ NULL
#' @param plot_type plot type. Allowed values are one of "b" for both line and point;
#' "l" for line only; and "p" for point only. Default is "b".
#' @param shape point shapes.
#' @param stroke point stroke. Used only for shapes 21-24 to control the thickness of points border.
#' @param show.line.label logical value. If TRUE, shows line labels.
#' @param point.size point size.
#' @param point.color point color.
Expand Down Expand Up @@ -123,7 +124,8 @@ ggline<- function(data, x, y, group = 1,
color = "black", palette = NULL,
linetype = "solid",
plot_type = c("b", "l", "p"),
size = 0.5, shape = 19, point.size = size, point.color = color,
size = 0.5, shape = 19, stroke = NULL,
point.size = size, point.color = color,
title = NULL, xlab = NULL, ylab = NULL,
facet.by = NULL, panel.labs = NULL, short.panel.labs = TRUE,
select = NULL, remove = NULL, order = NULL,
Expand All @@ -145,7 +147,7 @@ ggline<- function(data, x, y, group = 1,
combine = combine, merge = merge,
color = color, palette = palette,
linetype = linetype, plot_type = plot_type,
size = size, shape = shape,
size = size, shape = shape, stroke = stroke,
point.size = point.size, point.color = point.color,
title = title, xlab = xlab, ylab = ylab,
facet.by = facet.by, panel.labs = panel.labs, short.panel.labs = short.panel.labs,
Expand Down Expand Up @@ -183,7 +185,7 @@ ggline_core <- function(data, x, y, group = 1,
color = "black", fill = "white", palette = NULL,
linetype = "solid",
plot_type = c("b", "l", "p"),
size = 0.5, shape = 19,
size = 0.5, shape = 19, stroke = NULL,
point.size = size, point.color = color,
title = NULL, xlab = NULL, ylab = NULL,
select = NULL, order = NULL,
Expand Down Expand Up @@ -279,7 +281,7 @@ ggline_core <- function(data, x, y, group = 1,
p <- p +
geom_exec(geom_point, data = data_sum,
color = point.color, shape = shape,
size = 1.2+point.size)
size = 1.2+point.size, stroke = stroke)
# Adjust shape when ngroups > 6, to avoid ggplot warnings
p <-.scale_point_shape(p, data_sum, shape)
}
Expand Down
3 changes: 3 additions & 0 deletions man/ggline.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cd9bcd9

Please sign in to comment.