diff --git a/NEWS.md b/NEWS.md index fa724526..cc4373d4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,6 +6,8 @@ ## Bug fixes +- In `ggscatterhist()` the x variable was plotted two times, on both the plot x & y margins, instead of having, as expected, a) the x variable on the main plot x margin and 2) the y variable on the main plot y margin. This has been now fixed. + # ggpubr 0.1.6 ## New features diff --git a/R/ggscatterhist.R b/R/ggscatterhist.R index e8c0d08c..c0d7666b 100644 --- a/R/ggscatterhist.R +++ b/R/ggscatterhist.R @@ -130,7 +130,7 @@ ggscatterhist <- function( yplot <- ggplot() + margin.params %>% .add_item(geomfunc = geomfunc, data = data, - x = xplot.x, y = xplot.y, alpha = 0.7) %>% + x = yplot.x, y = yplot.y, alpha = 0.7) %>% do.call(geom_exec, .) yplot <- set_palette(yplot, palette)