Skip to content

Commit

Permalink
fix: set height in ggplot2::position_jitter() to 0 to avoid ver…
Browse files Browse the repository at this point in the history
…tical dispersion points (#46)

* Increment version number to 2.0.5

* fix: set `height` in `ggplot2::position_jitter()` to `0` to avoid vertical dispersion points.

Fixes #45
  • Loading branch information
mcanouil authored Aug 6, 2023
1 parent 7784ecd commit e299998
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: NACHO
Title: NanoString Quality Control Dashboard
Version: 2.0.4
Version: 2.0.5
Authors@R:
c(person(given = "Mickaël",
family = "Canouil",
Expand Down
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# NACHO 2.0.5

## Fixes

- In `R/autoplot.R`,
- fix: set `height` in `ggplot2::position_jitter()` to `0` to avoid vertical dispersion points. ([#45](https://github.com/mcanouil/NACHO/issues/45))

**Full Changelog**: <https://github.com/mcanouil/NACHO/compare/v2.0.4...v2.0.5>

# NACHO 2.0.4

## Fixes
Expand Down
12 changes: 6 additions & 6 deletions R/autoplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -317,15 +317,15 @@ plot_metrics <- function(
ggplot2::geom_point(
data = ~ .x[!(is_outlier)],
size = size, width = 0.25, na.rm = TRUE,
position = ggplot2::position_jitter(width = 0.25)
position = ggplot2::position_jitter(width = 0.25, height = 0)
),
ggplot2::geom_point(
data = ~ .x[(is_outlier)],
size = size * outliers_factor,
colour = "#b22222",
width = 0.25,
na.rm = TRUE,
position = ggplot2::position_jitter(width = 0.25)
position = ggplot2::position_jitter(width = 0.25, height = 0)
),
if (!is.null(outliers_labels)) {
ggrepel::geom_label_repel(
Expand All @@ -339,7 +339,7 @@ plot_metrics <- function(
} else {
ggplot2::geom_point(
size = size, width = 0.25, na.rm = TRUE,
position = ggplot2::position_jitter(width = 0.25)
position = ggplot2::position_jitter(width = 0.25, height = 0)
)
}
} +
Expand Down Expand Up @@ -450,15 +450,15 @@ plot_cg <- function(
ggplot2::geom_point(
data = ~ .x[!(is_outlier)],
size = size, width = 0.25, na.rm = TRUE,
position = ggplot2::position_jitter(width = 0.25)
position = ggplot2::position_jitter(width = 0.25, height = 0)
),
ggplot2::geom_point(
data = ~ .x[(is_outlier)],
size = size * outliers_factor,
colour = "#b22222",
width = 0.25,
na.rm = TRUE,
position = ggplot2::position_jitter(width = 0.25)
position = ggplot2::position_jitter(width = 0.25, height = 0)
),
if (!is.null(outliers_labels)) {
ggrepel::geom_label_repel(
Expand All @@ -472,7 +472,7 @@ plot_cg <- function(
} else {
ggplot2::geom_point(
size = size, width = 0.25, na.rm = TRUE,
position = ggplot2::position_jitter(width = 0.25)
position = ggplot2::position_jitter(width = 0.25, height = 0)
)
}
} +
Expand Down

0 comments on commit e299998

Please sign in to comment.