Skip to content

Commit

Permalink
Fix format for text
Browse files Browse the repository at this point in the history
  • Loading branch information
jpquast committed Dec 2, 2023
1 parent b22a5b6 commit 2a0a30b
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ggplate 0.1.1

* Fix R version requirement. Is now `4.1.0` and not `4.0.0` anymore. This fixes issue #15.
* Fix issue introduced in version 0.1.0. While attempting to remove trailing zeros, we inadvertently introduced some undesired side effects associated with the format() function. This resulted in incorrectly formatted text labels due to leading and trailing whitespaces.
* Update documentation to inform about `conda` package version.
* Update documentation to inform about potentially undesired behavior of new graphics device being opened by function when used in command line. This can be suppressed by setting `scale` argument.

Expand Down
8 changes: 5 additions & 3 deletions R/plate_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -480,10 +480,12 @@ plate_plot <- function(data,
{
if (!missing(label)) ggplot2::geom_text(ggplot2::aes(x = col,
y = .data$row_num,
label = paste0(format(
label = format(
{{ label }},
drop0Trailing = F)
)),
drop0Trailing = FALSE, # does not drop trailing 0
justify = "none", # does not add white spaces for justification
trim = TRUE) # removes leading white spaces
),
colour = data_prep$label_colours,
size = label_size_scaled)
} +
Expand Down
3 changes: 2 additions & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Submission

* Fixed two bugs in the `plate_plot()` function.
* Fixed a bug in the `plate_plot()` function (see NEWS).
* Also updated the R version requirement, which was incorrectly set to `4.0.0`, while at least `4.1.0` is needed.

## Test environments
* macOS-latest (on GitHub actions), R 4.3.2
Expand Down
Binary file modified man/figures/README-6_well_plot_new_colours_no_legend-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-discrete_96_well_plate_label-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-standard_plot_labels_wells-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2a0a30b

Please sign in to comment.