diff --git a/NEWS.md b/NEWS.md index c0f23bb..3500e6a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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. diff --git a/R/plate_plot.R b/R/plate_plot.R index 6b3c14d..359d151 100644 --- a/R/plate_plot.R +++ b/R/plate_plot.R @@ -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) } + diff --git a/cran-comments.md b/cran-comments.md index a0b0eb4..8f0acf0 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -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 diff --git a/man/figures/README-6_well_plot_new_colours_no_legend-1.png b/man/figures/README-6_well_plot_new_colours_no_legend-1.png index 0d2ff53..e062a82 100644 Binary files a/man/figures/README-6_well_plot_new_colours_no_legend-1.png and b/man/figures/README-6_well_plot_new_colours_no_legend-1.png differ diff --git a/man/figures/README-discrete_96_well_plate_label-1.png b/man/figures/README-discrete_96_well_plate_label-1.png index 7004d02..8b5454d 100644 Binary files a/man/figures/README-discrete_96_well_plate_label-1.png and b/man/figures/README-discrete_96_well_plate_label-1.png differ diff --git a/man/figures/README-standard_plot_labels_wells-1.png b/man/figures/README-standard_plot_labels_wells-1.png index cfd22da..a7ab399 100644 Binary files a/man/figures/README-standard_plot_labels_wells-1.png and b/man/figures/README-standard_plot_labels_wells-1.png differ